Comparing version 0.10.3 to 0.10.4
@@ -17,7 +17,6 @@ import { TimeSpan, createDate } from "oslo"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -59,3 +58,3 @@ async validateAuthorizationCode(code) { | ||
expiresIn: new TimeSpan(5, "m"), | ||
audience, | ||
audiences: [audience], | ||
subject: this.credentials.clientId | ||
@@ -62,0 +61,0 @@ }); |
@@ -16,5 +16,5 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
const url = await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes | ||
}); | ||
url.searchParams.set("state", state); | ||
url.searchParams.set("audience", "api.atlassian.com"); | ||
@@ -21,0 +21,0 @@ url.searchParams.set("prompt", "consent"); |
@@ -9,3 +9,3 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
const authorizeEndpoint = this.appDomain + "/authorize"; | ||
const tokenEndpoint = this.appDomain + "/token"; | ||
const tokenEndpoint = this.appDomain + "/oauth/token"; | ||
this.client = new OAuth2Client(clientId, authorizeEndpoint, tokenEndpoint, { | ||
@@ -18,7 +18,6 @@ redirectURI | ||
const scopes = options?.scopes ?? []; | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: [...scopes, "openid"] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -25,0 +24,0 @@ async validateAuthorizationCode(code) { |
@@ -15,7 +15,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -22,0 +21,0 @@ async validateAuthorizationCode(code) { |
@@ -6,3 +6,3 @@ import type { OAuth2Provider } from "../index.js"; | ||
constructor(clientId: string, clientSecret: string, redirectURI: string); | ||
createAuthorizationURL(codeVerifier: string): Promise<URL>; | ||
createAuthorizationURL(state: string): Promise<URL>; | ||
validateAuthorizationCode(code: string): Promise<BoxTokens>; | ||
@@ -9,0 +9,0 @@ } |
@@ -13,5 +13,5 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
} | ||
async createAuthorizationURL(codeVerifier) { | ||
async createAuthorizationURL(state) { | ||
return await this.client.createAuthorizationURL({ | ||
codeVerifier | ||
state | ||
}); | ||
@@ -18,0 +18,0 @@ } |
@@ -15,7 +15,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -22,0 +21,0 @@ async validateAuthorizationCode(code) { |
@@ -16,7 +16,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
const scopes = options?.scopes ?? []; | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: [...scopes, "openid"] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -23,0 +22,0 @@ async validateAuthorizationCode(code) { |
@@ -15,7 +15,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -22,0 +21,0 @@ async validateAuthorizationCode(code) { |
@@ -15,7 +15,6 @@ import { TimeSpan, createDate } from "oslo"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -22,0 +21,0 @@ async validateAuthorizationCode(code) { |
@@ -14,7 +14,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -21,0 +20,0 @@ async validateAuthorizationCode(code) { |
@@ -16,7 +16,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -23,0 +22,0 @@ async validateAuthorizationCode(code) { |
@@ -17,6 +17,6 @@ import { TimeSpan, createDate } from "oslo"; | ||
const url = await this.client.createAuthorizationURL({ | ||
state, | ||
codeVerifier, | ||
scopes: [...scopes, "openid"] | ||
}); | ||
url.searchParams.set("state", state); | ||
url.searchParams.set("nonce", "_"); | ||
@@ -23,0 +23,0 @@ return url; |
@@ -15,7 +15,6 @@ import { TimeSpan, createDate } from "oslo"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -22,0 +21,0 @@ async validateAuthorizationCode(code) { |
@@ -18,8 +18,7 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
const scopes = options?.scopes ?? []; | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
codeVerifier, | ||
scopes: [...scopes, "openid"] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -26,0 +25,0 @@ async validateAuthorizationCode(code, codeVerifier) { |
@@ -1,2 +0,2 @@ | ||
import { OAuth2Client, generateState } from "oslo/oauth2"; | ||
import { OAuth2Client } from "oslo/oauth2"; | ||
import { TimeSpan, createDate } from "oslo"; | ||
@@ -16,10 +16,7 @@ const authorizeEndpoint = "https://access.line.me/oauth2/v2.1/authorize"; | ||
const scopes = options?.scopes ?? []; | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
codeVerifier, | ||
scopes: [...scopes, "openid"] | ||
}); | ||
if (!state) | ||
state = generateState(); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -26,0 +23,0 @@ async validateAuthorizationCode(code, codeVerifier) { |
@@ -16,7 +16,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
const scopes = options?.scopes ?? []; | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: [...scopes, "openid"] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -23,0 +22,0 @@ async validateAuthorizationCode(code) { |
@@ -17,6 +17,6 @@ import { TimeSpan, createDate } from "oslo"; | ||
const url = await this.client.createAuthorizationURL({ | ||
state, | ||
codeVerifier, | ||
scopes: [...scopes, "openid"] | ||
}); | ||
url.searchParams.set("state", state); | ||
url.searchParams.set("nonce", "_"); | ||
@@ -23,0 +23,0 @@ return url; |
@@ -14,5 +14,5 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
async createAuthorizationURL(state) { | ||
const url = await this.client.createAuthorizationURL(); | ||
url.searchParams.set("state", state); | ||
return url; | ||
return await this.client.createAuthorizationURL({ | ||
state | ||
}); | ||
} | ||
@@ -19,0 +19,0 @@ async validateAuthorizationCode(code) { |
@@ -15,7 +15,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -22,0 +21,0 @@ async validateAuthorizationCode(code) { |
@@ -14,7 +14,7 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
async createAuthorizationURL(state, codeVerifier, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
codeVerifier, | ||
scopes: options?.scopes | ||
scopes: options?.scopes ?? [] | ||
}); | ||
return url; | ||
} | ||
@@ -21,0 +21,0 @@ async validateAuthorizationCode(code, codeVerifier) { |
@@ -15,7 +15,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
const scopes = options?.scopes ?? []; | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: [...scopes, "openid"] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -22,0 +21,0 @@ async validateAuthorizationCode(code) { |
@@ -15,7 +15,6 @@ import { TimeSpan, createDate } from "oslo"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -22,0 +21,0 @@ async validateAuthorizationCode(code) { |
@@ -16,7 +16,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
const scopes = options?.scopes ?? []; | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: [...scopes, "basic"] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -23,0 +22,0 @@ async validateAuthorizationCode(code) { |
@@ -15,7 +15,6 @@ import { TimeSpan, createDate } from "oslo"; | ||
async createAuthorizationURL(state, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -22,0 +21,0 @@ async validateAuthorizationCode(code) { |
@@ -14,8 +14,7 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
async createAuthorizationURL(state, codeVerifier, options) { | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
codeVerifier, | ||
scopes: options?.scopes | ||
scopes: options?.scopes ?? [] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -22,0 +21,0 @@ async validateAuthorizationCode(code, codeVerifier) { |
@@ -16,7 +16,6 @@ import { OAuth2Client } from "oslo/oauth2"; | ||
const scopes = options?.scopes ?? []; | ||
const url = await this.client.createAuthorizationURL({ | ||
return await this.client.createAuthorizationURL({ | ||
state, | ||
scopes: [...scopes, "openid"] | ||
}); | ||
url.searchParams.set("state", state); | ||
return url; | ||
} | ||
@@ -23,0 +22,0 @@ async validateAuthorizationCode(code) { |
{ | ||
"name": "arctic", | ||
"type": "module", | ||
"version": "0.10.3", | ||
"version": "0.10.4", | ||
"description": "OAuth 2.0 with built-in providers", | ||
@@ -27,3 +27,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"oslo": "0.24.0" | ||
"oslo": "0.27.1" | ||
}, | ||
@@ -30,0 +30,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65210
1661
+ Addedoslo@0.27.1(transitive)
- Removedoslo@0.24.0(transitive)
Updatedoslo@0.27.1