Skip to content

Commit

Permalink
馃帹 validate ghost profile/token response (#7761)
Browse files Browse the repository at this point in the history
no issue

- check if profile or access token exists when receiving the response from Ghost Auth server
  • Loading branch information
kirrg001 committed Jan 31, 2017
1 parent 89d4013 commit eebdfab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/server/auth/auth-strategies.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,19 @@ strategies = {
* - via invite token
* - via normal auth
* - via setup
*
* @TODO: validate GhostAuth profile?
*/
ghostStrategy: function ghostStrategy(req, ghostAuthAccessToken, ghostAuthRefreshToken, profile, done) {
var inviteToken = req.body.inviteToken,
options = {context: {internal: true}},
handleInviteToken, handleSetup;

// CASE: socket hangs up for example
if (!ghostAuthAccessToken || !profile) {
return done(new errors.NoPermissionError({
help: 'Please try again.'
}));
}

handleInviteToken = function handleInviteToken() {
var user, invite;
inviteToken = utils.decodeBase64URLsafe(inviteToken);
Expand Down

0 comments on commit eebdfab

Please sign in to comment.