Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f460371

Browse files
fix: critical scope validation bug resolved
Merge pull request #228 from jorenvandeweyer/bugfix/validate-scope
2 parents 74f07c3 + fc403c3 commit f460371

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

‎lib/grant-types/authorization-code-grant-type.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ class AuthorizationCodeGrantType extends AbstractGrantType {
187187
* Save token.
188188
*/
189189

190-
async saveToken(user, client, authorizationCode, scope) {
191-
const validatedScope = await this.validateScope(user, client, scope);
192-
const accessToken = await this.generateAccessToken(client, user, scope);
193-
const refreshToken = await this.generateRefreshToken(client, user, scope);
190+
async saveToken(user, client, authorizationCode, requestedScope) {
191+
const validatedScope = await this.validateScope(user, client, requestedScope);
192+
const accessToken = await this.generateAccessToken(client, user, validatedScope);
193+
const refreshToken = await this.generateRefreshToken(client, user, validatedScope);
194194
const accessTokenExpiresAt = await this.getAccessTokenExpiresAt();
195195
const refreshTokenExpiresAt = await this.getRefreshTokenExpiresAt();
196196

‎lib/grant-types/client-credentials-grant-type.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ class ClientCredentialsGrantType extends AbstractGrantType {
6868
* Save token.
6969
*/
7070

71-
async saveToken(user, client, scope) {
72-
const validatedScope = await this.validateScope(user, client, scope);
73-
const accessToken = await this.generateAccessToken(client, user, scope);
74-
const accessTokenExpiresAt = await this.getAccessTokenExpiresAt(client, user, scope);
71+
async saveToken(user, client, requestedScope) {
72+
const validatedScope = await this.validateScope(user, client, requestedScope);
73+
const accessToken = await this.generateAccessToken(client, user, validatedScope);
74+
const accessTokenExpiresAt = await this.getAccessTokenExpiresAt(client, user, validatedScope);
7575
const token = {
7676
accessToken: accessToken,
7777
accessTokenExpiresAt: accessTokenExpiresAt,

‎lib/grant-types/password-grant-type.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ class PasswordGrantType extends AbstractGrantType {
8686
* Save token.
8787
*/
8888

89-
async saveToken(user, client, scope) {
90-
const validatedScope = await this.validateScope(user, client, scope);
91-
const accessToken = await this.generateAccessToken(client, user, scope);
92-
const refreshToken = await this.generateRefreshToken(client, user, scope);
89+
async saveToken(user, client, requestedScope) {
90+
const validatedScope = await this.validateScope(user, client, requestedScope);
91+
const accessToken = await this.generateAccessToken(client, user, validatedScope);
92+
const refreshToken = await this.generateRefreshToken(client, user, validatedScope);
9393
const accessTokenExpiresAt = await this.getAccessTokenExpiresAt();
9494
const refreshTokenExpiresAt = await this.getRefreshTokenExpiresAt();
9595

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /