auth-backend: move CookieConfigurer to auth-node

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-07-22 10:42:39 +02:00
parent 68ae81a6a7
commit 6c7952ee85
3 changed files with 24 additions and 16 deletions
+1
View File
@@ -31,6 +31,7 @@ export type {
BackstageIdentityResponse,
BackstageSignInResult,
BackstageUserIdentity,
CookieConfigurer,
IdentityApiGetIdentityRequest,
ProfileInfo,
TokenParams,
+20
View File
@@ -189,3 +189,23 @@ export type ProfileInfo = {
*/
picture?: string;
};
/**
* The callback used to resolve the cookie configuration for auth providers that use cookies.
* @public
*/
export type CookieConfigurer = (ctx: {
/** ID of the auth provider that this configuration applies to */
providerId: string;
/** The externally reachable base URL of the auth-backend plugin */
baseUrl: string;
/** The configured callback URL of the auth provider */
callbackUrl: string;
/** The origin URL of the app */
appOrigin: string;
}) => {
domain: string;
path: string;
secure: boolean;
sameSite?: 'none' | 'lax' | 'strict';
};