-
Notifications
You must be signed in to change notification settings - Fork 2
Auth Endpoints
N Vijay Narayanan edited this page Aug 16, 2022
·
14 revisions
GET: /api/auth/info
- Authorization Required:
authorizeSignIn - Gets roles based on the latest cohort year
Sample Response Body:
{
user: {
id: number;
name: string;
email: string;
profilePicUrl?: string;
githubUrl?: string;
linkedinUrl?: string;
personalSiteUrl?: string;
selfIntro?: string;
student?: {
id: number;
userId: number;
cohortYear: number;
projectId: number;
nusnetId: string;
matricNo: string;
},
adviser?: {
id: number
userId: number;
cohortYear: number;
projectIds: number[];
nusnetId: string;
matricNo: string;
};
mentor?: {
id: number,
userId: number;
cohortYear: number,
projectIds: number[],
},
administrator?: {
id: number,
userId: number;
startDate: string,
endDate: string,
};
}
}
POST /api/auth/sign-in
Request Body:
{
email: string,
password: string,
}
Response Body:
- Refer to response body of
/api/auth/info
GET /api/auth/sign-out
- Authorization Required:
authorizeSignIn - Signs user out and clears cookies
POST /api/auth/reset-password
- Sends an email to the user with a reset password link
- The reset password link contains the JWT token and the user's id
- Format for the reset password link is:
${frontend_route}/change-password?token={token}&id={userId} - The JWT token is the user ID signed with the hash of the user's current password
Request Body:
{
email: string
origin: string
}
Response Body:
{
message: string;
}
POST /api/auth/change-password
Request Body:
{
id: string;
token: string;
newPassword: string;
}
Response Body:
{
message: string;
}
-
Auth Endpoints
/api/auth -
Users Endpoints
/api/users -
Students Endpoints
/api/students -
Advisers Endpoints
/api/advisers -
Mentors Endpoints
/api/mentors -
Administrators Endpoints
/api/administrators -
Cohorts Endpoints
/api/cohorts -
Deadlines Endpoints
/api/deadlines -
Projects Endpoints
/api/projects -
Dashboard Endpoints
/api/dashboard -
Evaluation Relationships Endpoints
/api/relations -
Submissions Endpoints
/api/submissions -
Announcements Endpoints
/api/announcements -
Application Endpoints
/api/application -
Vote Events Endpoints
/api/vote-events -
AI Endpoints
/api/ai