mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 11:58:13 +00:00
fix: revalidate auth token
This commit is contained in:
parent
91e956b642
commit
797c43ed56
6 changed files with 523 additions and 487 deletions
|
|
@ -55,22 +55,8 @@ export class ClasschartsStudentClient extends ClasschartsClient {
|
|||
String(sessionCookies["student_session_credentials"])
|
||||
);
|
||||
this.sessionId = sessionID.session_id;
|
||||
await this.getNewSessionId();
|
||||
const user = await this.getStudentInfo();
|
||||
this.studentId = user.id;
|
||||
this.studentName = user.name;
|
||||
const pingFormData = new URLSearchParams();
|
||||
pingFormData.append("include_data", "true");
|
||||
const pingData = await this.makeAuthedRequest(
|
||||
this.API_BASE + "/ping",
|
||||
{
|
||||
method: "POST",
|
||||
data: pingFormData.toString(),
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
},
|
||||
{ includeMeta: true }
|
||||
);
|
||||
this.sessionId = pingData.meta.session_id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue