Skip to content

Commit

Permalink
fix: make ModuleOptions properties required
Browse files Browse the repository at this point in the history
  • Loading branch information
hkp22 committed Oct 23, 2024
1 parent a2b0197 commit 72bd80d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/runtime/types/ModuleOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ModuleOptions {
* The authentication mode.
* @default 'cookie'
*/
authMode?: 'cookie' | 'token';
authMode: 'cookie' | 'token';

/**
* The current application URL for the Referrer header. (Optional)
Expand Down Expand Up @@ -38,7 +38,7 @@ export interface ModuleOptions {
* The storage provider to use for the token.
* @default 'cookie'
*/
provider?: 'cookie' | 'localStorage';
provider: 'cookie' | 'localStorage';
};

/**
Expand Down Expand Up @@ -113,28 +113,28 @@ export interface ModuleOptions {
* If set to false, a 403 error is triggered.
* @default '/login'
*/
loginPath: string | false;
loginPath: string;

/**
* URL to redirect to when guest access is required (user must not be authenticated).
* If set to false, the plugin will throw an 403 error.
* @default '/'
*/
guestOnlyRedirect: string | false;
guestOnlyRedirect: string;

/**
* URL to redirect to after a successful login.
* If set to false, no redirection occurs.
* @default '/'
*/
redirectToAfterLogin: string | false;
redirectToAfterLogin: string;

/**
* URL to redirect to after logout.
* If set to false, no redirection occurs.
* @default '/'
*/
redirectToAfterLogout: string | false;
redirectToAfterLogout: string;
};

middlewareNames: {
Expand Down Expand Up @@ -163,5 +163,5 @@ export interface ModuleOptions {
*
* @default 3
*/
logLevel?: number;
logLevel: number;
}

0 comments on commit 72bd80d

Please sign in to comment.