Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/handlers/authorize-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ AuthorizeHandler.prototype.handle = async function(request, response) {

const requestedScope = this.getScope(request);
const validScope = await this.validateScope(user, client, requestedScope);
const authorizationCode = this.generateAuthorizationCode(client, user, validScope);
const authorizationCode = await this.generateAuthorizationCode(client, user, validScope);

const ResponseType = this.getResponseType(request);
const codeChallenge = this.getCodeChallenge(request);
Expand Down
7 changes: 4 additions & 3 deletions test/integration/handlers/authorize-handler_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,9 @@ describe('AuthorizeHandler integration', function() {
getClient: function() {
return client;
},
saveAuthorizationCode: function() {
return { authorizationCode: 12345, client: client };
generateAuthorizationCode: async () => 'some-code',
saveAuthorizationCode: async function(code) {
return { authorizationCode: code.authorizationCode, client: client };
}
};
const handler = new AuthorizeHandler({ authorizationCodeLifetime: 120, model: model });
Expand All @@ -586,7 +587,7 @@ describe('AuthorizeHandler integration', function() {
return handler.handle(request, response)
.then(function(data) {
data.should.eql({
authorizationCode: 12345,
authorizationCode: 'some-code',
client: client
});
})
Expand Down