diff --git a/e2e/cypress/common/login.ts b/e2e/cypress/common/login.ts index 41aaa50c6f..95900317f7 100644 --- a/e2e/cypress/common/login.ts +++ b/e2e/cypress/common/login.ts @@ -34,14 +34,15 @@ export const loginWithFakeOAuth2 = () => { expect(params.get('client_id')).to.eq('dummy_client_id'); expect(params.get('response_type')).to.eq('code'); expect(params.get('scope')).to.eq('openid email profile'); - }); + expect(params.get('state')).to.matches(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i); // should be the uuid generated by crypto - cy.contains('Fake OAuht2').should('be.visible'); - cy.visit( - HOST + - '/login/auth_callback/oauth2?code=this_is_dummy_code&redirect_uri=https%3A%2F%2Fdummy-url.com%2Fcallback' - ); - cy.contains('Projects').should('be.visible'); + cy.contains('Fake OAuht2').should('be.visible'); + cy.visit( + HOST + + `/login/auth_callback/oauth2?code=this_is_dummy_code&redirect_uri=https%3A%2F%2Fdummy-url.com%2Fcallback&state=${params.get('state')}` + ); + cy.contains('Projects').should('be.visible'); + }); }; export const loginViaForm = (username = USERNAME, password = PASSWORD) => { diff --git a/webapp/src/service/AnonymousIdService.ts b/webapp/src/service/AnonymousIdService.ts index 920d476fca..05ecd1fcd4 100644 --- a/webapp/src/service/AnonymousIdService.ts +++ b/webapp/src/service/AnonymousIdService.ts @@ -12,7 +12,6 @@ export const AnonymousIdService = { reset() { return localStorage.setItem( ANONYMOUS_ID_LOCAL_STORAGE_KEY, - // @ts-ignore crypto.randomUUID() ); },