-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
123 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* @copyright 2021-present Kriasoft (https://git.io/JOevo) | ||
*/ | ||
import { AuthorizationCode as Base } from "simple-oauth2"; | ||
export declare type AuthorizationCodeOptions = { | ||
/** | ||
* Google client ID. | ||
* @default process.env.GOOGLE_CLIENT_ID | ||
*/ | ||
id?: string; | ||
/** | ||
* Google client secret. | ||
* @default process.env.GOOGLE_CLIENT_SECRET | ||
*/ | ||
secret?: string; | ||
}; | ||
export declare class AuthorizationCode extends Base { | ||
constructor(options?: AuthorizationCodeOptions); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.AuthorizationCode = void 0; | ||
|
||
var _simpleOauth = require("simple-oauth2"); | ||
|
||
/** | ||
* @copyright 2021-present Kriasoft (https://git.io/JOevo) | ||
*/ | ||
class AuthorizationCode extends _simpleOauth.AuthorizationCode { | ||
constructor(options = {}) { | ||
var _options$id, _options$secret; | ||
|
||
super({ | ||
client: { | ||
id: (_options$id = options.id) !== null && _options$id !== void 0 ? _options$id : process.env.GOOGLE_CLIENT_ID, | ||
secret: (_options$secret = options.secret) !== null && _options$secret !== void 0 ? _options$secret : process.env.GOOGLE_CLIENT_SECRET | ||
}, | ||
auth: { | ||
tokenHost: "https://accounts.google.com", | ||
tokenPath: "/o/oauth2/v2/auth", | ||
authorizeHost: "https://www.googleapis.com", | ||
authorizePath: "/oauth2/v4/token" | ||
} | ||
}); | ||
} | ||
|
||
} | ||
|
||
exports.AuthorizationCode = AuthorizationCode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* @copyright 2021-present Kriasoft (https://git.io/JOevo) | ||
*/ | ||
|
||
import { AuthorizationCode as Base } from "simple-oauth2"; | ||
|
||
export type AuthorizationCodeOptions = { | ||
/** | ||
* Google client ID. | ||
* @default process.env.GOOGLE_CLIENT_ID | ||
*/ | ||
id?: string; | ||
|
||
/** | ||
* Google client secret. | ||
* @default process.env.GOOGLE_CLIENT_SECRET | ||
*/ | ||
secret?: string; | ||
}; | ||
|
||
export class AuthorizationCode extends Base { | ||
constructor(options: AuthorizationCodeOptions = {}) { | ||
super({ | ||
client: { | ||
id: options.id ?? (process.env.GOOGLE_CLIENT_ID as string), | ||
secret: options.secret ?? (process.env.GOOGLE_CLIENT_SECRET as string), | ||
}, | ||
auth: { | ||
tokenHost: "https://accounts.google.com", | ||
tokenPath: "/o/oauth2/v2/auth", | ||
authorizeHost: "https://www.googleapis.com", | ||
authorizePath: "/oauth2/v4/token", | ||
}, | ||
}); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.