3 var userScopes
= require('gitter-web-identity/lib/user-scopes');
5 function redirectAfterLogin(req
, res
) {
6 if (req
.session
&& req
.session
.githubScopeUpgrade
) {
7 delete req
.session
.githubScopeUpgrade
;
9 res
.render('github-upgrade-complete', {
10 oAuthCompletePostMessage
: JSON
.stringify({
11 type
: 'oauth_upgrade_complete',
12 scopes
: userScopes
.getScopesHash(req
.user
)
19 if (req
.session
&& req
.session
.returnTo
) {
20 res
.redirect(req
.session
.returnTo
);
26 res
.redirect('/' + user
.username
);
32 module
.exports
= redirectAfterLogin
;