From fd3cd600ff8b65ba4edbbf88c3a174ad77585161 Mon Sep 17 00:00:00 2001 From: Arthur Langley Date: Sat, 13 Jan 2024 18:41:14 +0000 Subject: [PATCH] tweak(packages/identity): update session type and requested scope --- packages/identity/logto/client.ts | 2 +- packages/identity/types/logto-auth.d.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/identity/logto/client.ts b/packages/identity/logto/client.ts index ae37abfe..0d5e2bf2 100644 --- a/packages/identity/logto/client.ts +++ b/packages/identity/logto/client.ts @@ -8,5 +8,5 @@ export const logtoClient = new LogtoClient({ cookieSecret: process.env.COOKIE_SECRET, cookieSecure: false, resources: [process.env.NEXT_PUBLIC_RESOURCE_AUDIENCE], - scopes: ['email', 'identities', 'read:all'], + scopes: ['email', 'identities', 'read:all', "write:all", "read:pagemetadata"], }); diff --git a/packages/identity/types/logto-auth.d.ts b/packages/identity/types/logto-auth.d.ts index 72dc81e1..f15d9b7e 100644 --- a/packages/identity/types/logto-auth.d.ts +++ b/packages/identity/types/logto-auth.d.ts @@ -1,11 +1,14 @@ interface V2Session { logto_id: string; + id: string; provider: string; providerId: string | number; name: string; image: string; logto_username: string; blacklisted: boolean; + scope: Array; + hasScope: (requiredScope: Array) => boolean; } export { V2Session };