Skip to content

Commit e838eec

Browse files
committed
Merge pull request #378 from CodeNow/SAN-726-home-redirection
SAN-726-home-redirection
2 parents 135dfe2 + 8d75d65 commit e838eec

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

client/controllers/home/controllerHome.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ function ControllerHome(
3838

3939
dataHome.data.hasPass = !!$location.search().password;
4040

41+
if ($location.search().auth) {
42+
verifyUserIsAuth(true);
43+
}
4144
$scope.goToInstance = verifyUserIsAuth;
4245

43-
function verifyUserIsAuth() {
46+
function verifyUserIsAuth(authed) {
4447
async.series([
4548
function (cb) {
4649
fetchUser(function (err, user) {
@@ -53,11 +56,11 @@ function ControllerHome(
5356
function sendUserSomewhere(cb) {
5457

5558
var thisUser = $scope.user;
56-
59+
var opts = authed ? {location: 'replace'} : null;
5760
$state.go('instance.home', {
5861
userName: keypather.get($localStorage, 'stateParams.userName') ||
5962
thisUser.oauthName()
60-
});
63+
}, opts);
6164
return cb();
6265

6366
}

client/services/configs/serviceConfigLoginURL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function configLoginURL(
88
configAPIHost
99
) {
1010
return function () {
11-
var redirect = encodeURI($window.location.protocol + '//' + $window.location.host);
11+
var redirect = encodeURI($window.location.protocol + '//' + $window.location.host + '/?auth');
1212
return configAPIHost + '/auth/github?redirect=' + redirect;
1313
};
1414
}

0 commit comments

Comments
 (0)