Skip to content

Commit a4f863a

Browse files
committed
Github now redirects back to the homepage with a special flag that is used to let the UI know to transfer the user to the instance.home
1 parent 874e905 commit a4f863a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

client/controllers/home/controllerHome.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ function ControllerHome(
3737
$window.s.refresh();
3838

3939
dataHome.data.hasPass = !!$location.search().password;
40+
dataHome.data.auth = !!$location.search().auth;
4041

42+
if (!!$location.search().auth) {
43+
verifyUserIsAuth(true);
44+
}
4145
$scope.goToInstance = verifyUserIsAuth;
4246

43-
function verifyUserIsAuth() {
47+
function verifyUserIsAuth(authed) {
4448
async.series([
4549
function (cb) {
4650
fetchUser(function (err, user) {
@@ -53,11 +57,11 @@ function ControllerHome(
5357
function sendUserSomewhere(cb) {
5458

5559
var thisUser = $scope.user;
56-
60+
var opts = authed ? {location: 'replace'} : null;
5761
$state.go('instance.home', {
5862
userName: keypather.get($localStorage, 'stateParams.userName') ||
5963
thisUser.oauthName()
60-
});
64+
}, opts);
6165
return cb();
6266

6367
}

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)