Browse Source
Merge pull request #8617 from abpframework/fix/8347
fix: set path of rememberMe cookie to /
pull/8622/head
Mehmet Erim
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
4 deletions
-
npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts
|
|
|
@ -129,18 +129,18 @@ export class AuthPasswordFlowStrategy extends AuthFlowStrategy { |
|
|
|
private setRememberMe(remember: boolean) { |
|
|
|
this.removeRememberMe(); |
|
|
|
localStorage.setItem(this.storageKey, 'true'); |
|
|
|
document.cookie = `${this.cookieKey}=true${ |
|
|
|
remember ? ';expires=Fri, 31 Dec 9999 23:59:59 GMT' : '' |
|
|
|
document.cookie = `${this.cookieKey}=true; path=/${ |
|
|
|
remember ? ' ;expires=Fri, 31 Dec 9999 23:59:59 GMT' : '' |
|
|
|
}`;
|
|
|
|
} |
|
|
|
|
|
|
|
private removeRememberMe() { |
|
|
|
localStorage.removeItem(this.storageKey); |
|
|
|
document.cookie = this.cookieKey + '= ; expires = Thu, 01 Jan 1970 00:00:00 GMT'; |
|
|
|
document.cookie = this.cookieKey + '= ; path=/; expires = Thu, 01 Jan 1970 00:00:00 GMT'; |
|
|
|
} |
|
|
|
|
|
|
|
async init() { |
|
|
|
if (!getCookieValueByName('rememberMe') && localStorage.getItem(this.storageKey)) { |
|
|
|
if (!getCookieValueByName(this.cookieKey) && localStorage.getItem(this.storageKey)) { |
|
|
|
this.oAuthService.logOut(); |
|
|
|
} |
|
|
|
|
|
|
|
|