File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments