Skip to content

Commit

Permalink
Return refresh token from access-token endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
evert committed Oct 28, 2024
1 parent a31c935 commit d827e06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

0.26.4 (????-??-??)
-------------------

* New: access-token endpoint now returns refresh token.


0.26.3 (2024-10-28)
-------------------

Expand Down
7 changes: 2 additions & 5 deletions src/oauth2/controller/user-access-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import log from '../../log/service.js';
import { EventType } from '../../log/types.js';
import { PrincipalService } from '../../principal/service.js';
import * as oauth2Service from '../service.js';
import { tokenResponse } from '../formats/json.js';

class UserAccessTokenController extends Controller {

Expand All @@ -22,11 +23,7 @@ class UserAccessTokenController extends Controller {
principal: user,
});

ctx.response.body = {
access_token: token.accessToken,
token_type: token.tokenType,
expires_in: token.accessTokenExpires - Math.round(Date.now() / 1000),
};
ctx.response.body = tokenResponse(token);
log(EventType.generateAccessToken, ctx.ip()!, user.id, ctx.request.headers.get('User-Agent'));

}
Expand Down

0 comments on commit d827e06

Please sign in to comment.