mirror of
https://github.com/twentyhq/twenty.git
synced 2026-04-18 22:12:14 -04:00
- Replaced `getAuthTokensFromLoginToken` with `getAccessTokensFromLoginToken` for clarity. - Introduced `getWorkspaceAgnosticTokenFromEmailVerificationToken`. - Extended mutation inputs to include `locale` and `verifyEmailNextPath`. - Added email verification check and sending to various handlers. - Updated GraphQL types and hooks to reflect these changes. Fix #13412 --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: Félix Malfait <felix@twenty.com>
16 lines
465 B
TypeScript
16 lines
465 B
TypeScript
import { Page } from '@playwright/test';
|
|
|
|
export const getAuthToken = async (page: Page) => {
|
|
const storageState = await page.context().storageState();
|
|
const authCookie = storageState.cookies.find(
|
|
(cookie) => cookie.name === 'tokenPair',
|
|
);
|
|
if (!authCookie) {
|
|
throw new Error('No auth cookie found');
|
|
}
|
|
const token = JSON.parse(decodeURIComponent(authCookie.value)).accessOrWorkspaceAgnosticToken
|
|
.token;
|
|
|
|
return { authToken: token };
|
|
};
|