Skip to content

Commit

Permalink
fix: login gets lost after a link is opened in a different tab (#938, #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Eisie96 authored and SGrueber committed May 18, 2022
1 parent a095d97 commit 4551931
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/core/utils/api-token/api-token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ export class ApiTokenService {
return { type: 'basket', apiToken };
} else if (orderId) {
return { type: 'order', apiToken, orderId };
} else {
const apiTokenCookieString = this.cookiesService.get('apiToken');
const apiTokenCookie: ApiTokenCookie = apiTokenCookieString
? JSON.parse(apiTokenCookieString)
: undefined;
if (apiToken && apiTokenCookie) {
return { ...apiTokenCookie, apiToken };
}
}
}),
distinctUntilChanged<ApiTokenCookie>(isEqual)
Expand Down

0 comments on commit 4551931

Please sign in to comment.