Skip to content

Commit

Permalink
fix #49: allow to set csrf token
Browse files Browse the repository at this point in the history
  • Loading branch information
AsakuraMizu committed May 20, 2024
1 parent fa11242 commit efab460
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ export class Learn2018Helper {
return this.#csrfToken;
}

/** manually set CSRF token (useful when you want to reuse previous token) */
public setCSRFToken(csrfToken: string): void {
this.#csrfToken = csrfToken;
}

/** login is necessary if you do not provide a `CredentialProvider` */
public async login(username?: string, password?: string): Promise<void> {
if (!username || !password) {
Expand Down

0 comments on commit efab460

Please sign in to comment.