UNPKG

bc-node-sdk

Version:

BetterCommerce's NodeJS SDK encapsulates the base framework for all the Next.js applications.

26 lines (25 loc) 1.24 kB
export default abstract class AuthUtil { /** * Generates the URL to redirect to after login. If returnUrl is provided, sets the RETURN_URL cookie with the returnUrl and redirects to the login page. * @param origin The origin of the application * @param loginUrl The URL of the login page * @param returnUrl The url to redirect to after login * @returns The url to redirect to */ static getPostAuthUrl(origin: string, loginUrl: string, returnUrl?: string): string; /** * Generates the login URL for the user. If returnUrl is provided, sets the RETURN_URL cookie with the returnUrl and redirects to the login page. * @param origin The origin of the application * @param orgId The organization ID * @param domainId The domain ID * @param returnUrl The url to redirect to after login * @returns The url to redirect to */ static getLoginUrl(origin: string, orgId?: string, domainId?: string, returnUrl?: string, search?: string): string; /** * Generates the logout URL for the user. * @param origin The origin of the application * @returns The url to redirect to */ static getLogoutUrl(origin: string): string; }