diff options
| author | Fuwn <[email protected]> | 2024-01-06 17:03:45 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-06 17:03:45 -0800 |
| commit | 7515d21ac9723b2a4df7dfd94f92acd4dd4e9ec9 (patch) | |
| tree | 184a0b5f3728bf2007c617146507ad8972ef619c /src/lib | |
| parent | refactor(api): simple oauth handler (diff) | |
| download | due.moe-7515d21ac9723b2a4df7dfd94f92acd4dd4e9ec9.tar.xz due.moe-7515d21ac9723b2a4df7dfd94f92acd4dd4e9ec9.zip | |
feat(api): myanimelist oauth
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/oauth.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/oauth.ts b/src/lib/oauth.ts index 53764fad..1c35223d 100644 --- a/src/lib/oauth.ts +++ b/src/lib/oauth.ts @@ -14,6 +14,7 @@ export interface CallbackOptions { authorise: string; redirect?: string; client: ClientOptions; + verifier?: string; } export const callback = async (options: CallbackOptions) => { @@ -25,6 +26,9 @@ export const callback = async (options: CallbackOptions) => { formData.append('client_secret', client.secret); formData.append('redirect_uri', client.redirectURI); formData.append('code', url.searchParams.get('code') || 'null'); + + if (options.verifier) formData.append('code_verifier', options.verifier); + cookies.set( cookie, JSON.stringify( |