ing
This commit is contained in:
@@ -3,7 +3,8 @@ import {
|
||||
CanActivate,
|
||||
CanActivateChild,
|
||||
ActivatedRouteSnapshot,
|
||||
RouterStateSnapshot
|
||||
RouterStateSnapshot,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
@@ -20,6 +21,7 @@ import { AuthSelector } from '@overflow/member/store';
|
||||
export class AuthGuard implements CanActivate, CanActivateChild {
|
||||
constructor(
|
||||
private store: Store<AuthStore.State>,
|
||||
private router: Router,
|
||||
private cookieService: CookieService,
|
||||
) { }
|
||||
|
||||
@@ -31,7 +33,8 @@ export class AuthGuard implements CanActivate, CanActivateChild {
|
||||
if (this.cookieService.check('authToken')) {
|
||||
this.store.dispatch(new AuthStore.SigninCookie({authToken: this.cookieService.get('authToken'), returnURL: state.url}));
|
||||
} else {
|
||||
this.store.dispatch(new AuthStore.SigninRedirect(state.url));
|
||||
// this.store.dispatch(new AuthStore.SigninRedirect(state.url));
|
||||
this.router.navigateByUrl(state.url);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1 +1,8 @@
|
||||
<of-member-signin></of-member-signin>
|
||||
<div class="ui-g">
|
||||
<div class="ui-g-12 ui-md-9 ui-lg-7">
|
||||
<of-member-signin-container></of-member-signin-container>
|
||||
</div>
|
||||
<div class="ui-g-12 ui-md-3 ui-lg-5 login-descript">
|
||||
<of-site-banner-container></of-site-banner-container>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1 +1 @@
|
||||
<of-noauth-list-container></of-noauth-list-container>
|
||||
<of-noauth-probe-list-container></of-noauth-probe-list-container>
|
||||
Reference in New Issue
Block a user