Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support unique credential cookie names #560

Merged
merged 17 commits into from
Jul 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update src/sessions/SessionManager.ts
Co-authored-by: Quinn Hanam <[email protected]>
limhjgrace and qhanam authored Jun 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b97d3c07c221a41d2c46126382e8b66ca99dc910
6 changes: 1 addition & 5 deletions src/sessions/SessionManager.ts
Original file line number Diff line number Diff line change
@@ -176,11 +176,7 @@
private createOrRenewSessionCookie(session: Session, expires: Date) {
if (btoa) {
storeCookie(
getCookieName(
this.config.cookieAttributes.unique,
SESSION_COOKIE_NAME,
this.appMonitorDetails.id!
),
this.sessionCookieName,

Check failure on line 179 in src/sessions/SessionManager.ts

GitHub Actions / Run Integ Tests on ubuntu-20.04

Property 'sessionCookieName' does not exist on type 'SessionManager'.

Check failure on line 179 in src/sessions/SessionManager.ts

GitHub Actions / Run Integ Tests on windows-latest

Property 'sessionCookieName' does not exist on type 'SessionManager'.
btoa(JSON.stringify(session)),
this.config.cookieAttributes,
undefined,

Unchanged files with check annotations Beta

import { getCookieName } from '../utils/cookies-utils';
export abstract class Authentication {
protected applicationId: string;

Check failure on line 9 in src/dispatch/Authentication.ts

GitHub Actions / Run Integ Tests on ubuntu-20.04

Property 'applicationId' has no initializer and is not definitely assigned in the constructor.

Check failure on line 9 in src/dispatch/Authentication.ts

GitHub Actions / Run Integ Tests on windows-latest

Property 'applicationId' has no initializer and is not definitely assigned in the constructor.
protected cognitoIdentityClient: CognitoIdentityClient;
protected config: Config;
protected credentials: AwsCredentialIdentity | undefined;
fetchRequestHandler: new FetchHttpHandler(),
region
});
this.credentialStorageKey = this.config.cookieAttributes.unique

Check failure on line 21 in src/dispatch/Authentication.ts

GitHub Actions / Run Integ Tests on ubuntu-20.04

Property 'credentialStorageKey' does not exist on type 'Authentication'.

Check failure on line 21 in src/dispatch/Authentication.ts

GitHub Actions / Run Integ Tests on windows-latest

Property 'credentialStorageKey' does not exist on type 'Authentication'.
? `${CRED_KEY}_${this.applicationId}`

Check failure on line 22 in src/dispatch/Authentication.ts

GitHub Actions / Run Integ Tests on ubuntu-20.04

Property 'applicationId' is used before being assigned.

Check failure on line 22 in src/dispatch/Authentication.ts

GitHub Actions / Run Integ Tests on windows-latest

Property 'applicationId' is used before being assigned.
: CRED_KEY;
}
try {
credentials = JSON.parse(
localStorage.getItem(
this.credentialStorageKey

Check failure on line 90 in src/dispatch/Authentication.ts

GitHub Actions / Run Integ Tests on ubuntu-20.04

Property 'credentialStorageKey' does not exist on type 'Authentication'.

Check failure on line 90 in src/dispatch/Authentication.ts

GitHub Actions / Run Integ Tests on windows-latest

Property 'credentialStorageKey' does not exist on type 'Authentication'.
)!
);
} catch (e) {