Make options optional

Revert default routes
Update documentation
This commit is contained in:
René Preuß
2023-04-08 18:26:18 +02:00
parent 1560ae2038
commit 734b495ec0
6 changed files with 25 additions and 35 deletions

View File

@@ -3,32 +3,32 @@ import defu from "defu";
// Module options TypeScript interface definition
export interface ModuleOptions {
redirect: {
login: string,
logout: string,
callback: string,
home: string
redirect?: {
login?: string,
logout?: string,
callback?: string,
home?: string
},
endpoints: {
authorization: string,
token: string,
userInfo: string,
logout: string | null
endpoints?: {
authorization?: string,
token?: string,
userInfo?: string,
logout?: string | null
},
refreshToken: {
refreshToken?: {
maxAge: number,
}
clientId: string,
responseType: 'token' | 'code',
prompt: '' | 'none' | 'login' | 'consent',
scope: string[]
clientId?: string,
responseType?: 'token' | 'code',
prompt?: '' | 'none' | 'login' | 'consent',
scope?: string[]
}
const defaults: ModuleOptions = {
redirect: {
login: '/auth/login',
login: '/login',
logout: '/',
callback: '/auth/login',
callback: '/login',
home: '/'
},
endpoints: {