Buckets:
| import { OAuth2Client } from "../client.js"; | |
| export class Auth0 { | |
| authorizationEndpoint; | |
| tokenEndpoint; | |
| tokenRevocationEndpoint; | |
| client; | |
| constructor(domain, clientId, clientSecret, redirectURI) { | |
| this.authorizationEndpoint = `https://${domain}/authorize`; | |
| this.tokenEndpoint = `https://${domain}/oauth/token`; | |
| this.tokenRevocationEndpoint = `https://${domain}/oauth/revoke`; | |
| this.client = new OAuth2Client(clientId, clientSecret, redirectURI); | |
| } | |
| createAuthorizationURL(state, scopes) { | |
| const url = this.client.createAuthorizationURL(this.authorizationEndpoint, state, scopes); | |
| return url; | |
| } | |
| async validateAuthorizationCode(code) { | |
| const tokens = await this.client.validateAuthorizationCode(this.tokenEndpoint, code, null); | |
| return tokens; | |
| } | |
| async refreshAccessToken(refreshToken) { | |
| const tokens = await this.client.refreshAccessToken(this.tokenEndpoint, refreshToken, []); | |
| return tokens; | |
| } | |
| async revokeToken(token) { | |
| await this.client.revokeToken(this.tokenRevocationEndpoint, token); | |
| } | |
| } | |
Xet Storage Details
- Size:
- 1.13 kB
- Xet hash:
- c7dc17ea82e8e404a2b9a61395699cd3fcc29eb2b8d69bf76a94290173785ff8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.