mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 09:12:02 +10:00
feat: migrate nextjs to rr7
This commit is contained in:
37
packages/auth/server/config.ts
Normal file
37
packages/auth/server/config.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import { NEXT_PUBLIC_WEBAPP_URL } from '@documenso/lib/constants/app';
|
||||
import { env } from '@documenso/lib/utils/env';
|
||||
|
||||
/**
|
||||
* How long a session should live for in milliseconds.
|
||||
*/
|
||||
export const AUTH_SESSION_LIFETIME = 1000 * 60 * 60 * 24 * 30; // 30 days.
|
||||
|
||||
export type OAuthClientOptions = {
|
||||
id: string;
|
||||
scope: string[];
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
wellKnownUrl: string;
|
||||
redirectUrl: string;
|
||||
bypassEmailVerification?: boolean;
|
||||
};
|
||||
|
||||
export const GoogleAuthOptions: OAuthClientOptions = {
|
||||
id: 'google',
|
||||
scope: ['openid', 'email', 'profile'],
|
||||
clientId: env('NEXT_PRIVATE_GOOGLE_CLIENT_ID') ?? '',
|
||||
clientSecret: env('NEXT_PRIVATE_GOOGLE_CLIENT_SECRET') ?? '',
|
||||
redirectUrl: `${NEXT_PUBLIC_WEBAPP_URL()}/api/auth/callback/google`,
|
||||
wellKnownUrl: 'https://accounts.google.com/.well-known/openid-configuration',
|
||||
bypassEmailVerification: false,
|
||||
};
|
||||
|
||||
export const OidcAuthOptions: OAuthClientOptions = {
|
||||
id: 'oidc',
|
||||
scope: ['openid', 'email', 'profile'],
|
||||
clientId: env('NEXT_PRIVATE_OIDC_CLIENT_ID') ?? '',
|
||||
clientSecret: env('NEXT_PRIVATE_OIDC_CLIENT_SECRET') ?? '',
|
||||
redirectUrl: `${NEXT_PUBLIC_WEBAPP_URL()}/api/auth/callback/oidc`,
|
||||
wellKnownUrl: env('NEXT_PRIVATE_OIDC_WELL_KNOWN') ?? '',
|
||||
bypassEmailVerification: env('NEXT_PRIVATE_OIDC_SKIP_VERIFY') === 'true',
|
||||
};
|
||||
Reference in New Issue
Block a user