@vyro-x/react-auth
Advanced tools
Comparing version 1.9.0 to 1.10.0
@@ -15,2 +15,5 @@ "use strict"; | ||
const config = (0, config_1.getConfig)(); | ||
if (typeof config.getLoginUrl === 'function') { | ||
return config.getLoginUrl(args); | ||
} | ||
const loginUrl = new URL(config.authFrontendUrl); | ||
@@ -17,0 +20,0 @@ loginUrl.pathname = '/login'; |
@@ -1,11 +0,3 @@ | ||
import { AuthArgs } from '../types'; | ||
type LogoutArgs = { | ||
/** | ||
* The URL to redirect to immediately after the user has logged out. | ||
* @default The login page | ||
*/ | ||
post_logout_callback_url?: string; | ||
} & AuthArgs; | ||
import { LogoutArgs } from '../types'; | ||
export declare const logout: (args?: LogoutArgs) => Promise<void>; | ||
export declare const getLogoutUrl: (args?: LogoutArgs) => string; | ||
export {}; |
@@ -19,2 +19,5 @@ "use strict"; | ||
const config = (0, config_1.getConfig)(); | ||
if (typeof config.getLogoutUrl === 'function') { | ||
return config.getLogoutUrl(args); | ||
} | ||
const logoutUrl = new URL(config.authFrontendUrl); | ||
@@ -21,0 +24,0 @@ logoutUrl.pathname = '/logout'; |
@@ -15,2 +15,5 @@ "use strict"; | ||
const config = (0, config_1.getConfig)(); | ||
if (typeof config.getSignupUrl === 'function') { | ||
return config.getSignupUrl(args); | ||
} | ||
const signUpUrl = new URL(config.authFrontendUrl); | ||
@@ -17,0 +20,0 @@ signUpUrl.pathname = '/signup'; |
@@ -27,2 +27,9 @@ export type Roles = 'admin' | 'customer' | 'public' | 'showroom:manager' | 'showroom:support' | 'showroom:reporting'; | ||
}; | ||
export type LogoutArgs = { | ||
/** | ||
* The URL to redirect to immediately after the user has logged out. | ||
* @default The login page | ||
*/ | ||
post_logout_callback_url?: string; | ||
} & AuthArgs; | ||
export type AuthConfig = { | ||
@@ -33,2 +40,5 @@ authFrontendUrl: string; | ||
onLogout?: () => Promise<void> | void; | ||
getSignupUrl?: (args: AuthArgs) => string; | ||
getLoginUrl?: (args: AuthArgs) => string; | ||
getLogoutUrl?: (args: LogoutArgs) => string; | ||
}; |
{ | ||
"name": "@vyro-x/react-auth", | ||
"description": "Client authentication", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
35246
756