| |
| export interface IframeCookieOptions { |
| expires?: Date; |
| maxAge?: number; |
| sameSite?: "strict" | "lax" | "none"; |
| secure?: boolean; |
| partitioned?: boolean; |
| domain?: string; |
| path?: string; |
| } |
|
|
| |
| |
| |
| |
| export function getIframeCookieOptions( |
| customOptions: Partial<IframeCookieOptions> = {} |
| ): IframeCookieOptions { |
| return { |
| sameSite: "none", |
| secure: true, |
| partitioned: true, |
| path: "/", |
| ...customOptions, |
| }; |
| } |
|
|
| |
| |
| |
| export function getAuthCookieOptions(expiresIn?: number): IframeCookieOptions { |
| return getIframeCookieOptions({ |
| expires: expiresIn |
| ? new Date(Date.now() + expiresIn * 1000) |
| : undefined, |
| }); |
| } |
|
|
| |
| |
| |
| |
| export function getRemoveCookieOptions(): IframeCookieOptions { |
| return getIframeCookieOptions({ |
| expires: new Date(0), |
| }); |
| } |
|
|