|
|
@ -111,6 +111,10 @@ class OAuth2Service extends SiteService {
|
|
|
|
|
|
|
|
|
|
|
|
app.post(
|
|
|
|
app.post(
|
|
|
|
'/oauth2/token',
|
|
|
|
'/oauth2/token',
|
|
|
|
|
|
|
|
(req, res, next) => {
|
|
|
|
|
|
|
|
this.log.debug('POST /oauth2/token', { body: req.body, params: req.params, query: req.query });
|
|
|
|
|
|
|
|
return next();
|
|
|
|
|
|
|
|
},
|
|
|
|
passport.authenticate(['basic', 'oauth2-client-password'], { session: false }),
|
|
|
|
passport.authenticate(['basic', 'oauth2-client-password'], { session: false }),
|
|
|
|
this.server.token(),
|
|
|
|
this.server.token(),
|
|
|
|
this.server.errorHandler(),
|
|
|
|
this.server.errorHandler(),
|
|
|
@ -178,8 +182,6 @@ class OAuth2Service extends SiteService {
|
|
|
|
username_lc: authCode.user.username_lc,
|
|
|
|
username_lc: authCode.user.username_lc,
|
|
|
|
displayName: authCode.user.displayName,
|
|
|
|
displayName: authCode.user.displayName,
|
|
|
|
bio: authCode.user.bio,
|
|
|
|
bio: authCode.user.bio,
|
|
|
|
permissions: authCode.user.permissions,
|
|
|
|
|
|
|
|
flags: authCode.user.flags,
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
await Promise.all([
|
|
|
|
await Promise.all([
|
|
|
|