Skip to content

Commit

Permalink
Parameterize the frontend source on auth callback window
Browse files Browse the repository at this point in the history
  • Loading branch information
miro committed Jan 9, 2016
1 parent 0510667 commit cccc985
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ app.get('/auth/facebook/callback',
log.debug('auth ok!', user);
var token = tokenService.getToken(user);

res.render('auth-callback', { token, user });
res.render('auth-callback', { token, user, frontendUrl: config.frontendUrl });
}
);

Expand Down
2 changes: 1 addition & 1 deletion views/auth-callback.jade
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ html(lang="en")
console.log('Event received from the parent window!', event);

// Send event back into it, if origin matches
if (event.origin === 'http://localhost:3000') { // TODO parameterize the URL
if (event.origin === '#{frontendUrl}') {
event.source.postMessage('#{token}', '*');
window.close();
}
Expand Down

0 comments on commit cccc985

Please sign in to comment.