Update creation flow refactor docs and auth test fixtures
This commit is contained in:
@@ -122,6 +122,11 @@ function createTestConfig(
|
||||
mockAvatarUrl: '',
|
||||
},
|
||||
authSession: {
|
||||
accessCookieName: 'genarrative_access_session',
|
||||
accessCookieTtlSeconds: 7200,
|
||||
accessCookieSecure: false,
|
||||
accessCookieSameSite: 'Lax',
|
||||
accessCookiePath: '/',
|
||||
refreshCookieName: 'genarrative_refresh_session',
|
||||
refreshSessionTtlDays: 30,
|
||||
refreshCookieSecure: false,
|
||||
@@ -467,7 +472,18 @@ async function startWechatMockFlow(baseUrl: string, redirectPath = '/') {
|
||||
const location = callbackResponse.headers.get('location') || '';
|
||||
assert.ok(location);
|
||||
const hash = parseRedirectHash(location);
|
||||
const token = hash.get('auth_token') || '';
|
||||
const setCookieHeader = callbackResponse.headers.get('set-cookie') || '';
|
||||
const accessCookie = setCookieHeader
|
||||
.split(',')
|
||||
.map((entry) => entry.trim())
|
||||
.find((entry) => entry.startsWith('genarrative_access_session='));
|
||||
const token =
|
||||
accessCookie
|
||||
?.split(';')[0]
|
||||
?.split('=')
|
||||
.slice(1)
|
||||
.join('=')
|
||||
.trim() || '';
|
||||
|
||||
assert.ok(token);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user