@propelauth/react
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -356,8 +356,26 @@ 'use strict'; | ||
redirectToSignupPage() { | ||
window.location.href = `${clientState.authUrl}/signup`; | ||
redirectToSignupPage(options) { | ||
let qs = ""; | ||
if (options && options.postSignupRedirectUrl) { | ||
const encode = window ? window.btoa : btoa; | ||
qs = new URLSearchParams({ | ||
"rt": encode(options.postSignupRedirectUrl) | ||
}).toString(); | ||
} | ||
window.location.href = `${clientState.authUrl}/signup?${qs}`; | ||
}, | ||
redirectToLoginPage() { | ||
window.location.href = `${clientState.authUrl}/login`; | ||
redirectToLoginPage(options) { | ||
let qs = ""; | ||
if (options && options.postLoginRedirectUrl) { | ||
const encode = window ? window.btoa : btoa; | ||
qs = new URLSearchParams({ | ||
"rt": encode(options.postLoginRedirectUrl) | ||
}).toString(); | ||
} | ||
window.location.href = `${clientState.authUrl}/login?${qs}`; | ||
}, | ||
@@ -364,0 +382,0 @@ |
@@ -348,8 +348,26 @@ import React, { useContext, useReducer, useState, useMemo, useEffect, useCallback } from 'react'; | ||
redirectToSignupPage() { | ||
window.location.href = `${clientState.authUrl}/signup`; | ||
redirectToSignupPage(options) { | ||
let qs = ""; | ||
if (options && options.postSignupRedirectUrl) { | ||
const encode = window ? window.btoa : btoa; | ||
qs = new URLSearchParams({ | ||
"rt": encode(options.postSignupRedirectUrl) | ||
}).toString(); | ||
} | ||
window.location.href = `${clientState.authUrl}/signup?${qs}`; | ||
}, | ||
redirectToLoginPage() { | ||
window.location.href = `${clientState.authUrl}/login`; | ||
redirectToLoginPage(options) { | ||
let qs = ""; | ||
if (options && options.postLoginRedirectUrl) { | ||
const encode = window ? window.btoa : btoa; | ||
qs = new URLSearchParams({ | ||
"rt": encode(options.postLoginRedirectUrl) | ||
}).toString(); | ||
} | ||
window.location.href = `${clientState.authUrl}/login?${qs}`; | ||
}, | ||
@@ -356,0 +374,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { AuthenticationInfo } from "@propelauth/javascript"; | ||
import { AuthenticationInfo, RedirectToLoginOptions, RedirectToSignupOptions } from "@propelauth/javascript"; | ||
import React from "react"; | ||
@@ -9,4 +9,4 @@ interface InternalAuthState { | ||
selectOrgId: (orgId: string) => void; | ||
redirectToLoginPage: () => void; | ||
redirectToSignupPage: () => void; | ||
redirectToLoginPage: (options?: RedirectToLoginOptions) => void; | ||
redirectToSignupPage: (options?: RedirectToSignupOptions) => void; | ||
redirectToAccountPage: () => void; | ||
@@ -13,0 +13,0 @@ redirectToOrgPage: (orgId?: string) => void; |
export { UserRole } from "@propelauth/javascript"; | ||
export type { OrgIdToOrgMemberInfo, OrgMemberInfo, User } from "@propelauth/javascript"; | ||
export type { OrgIdToOrgMemberInfo, OrgMemberInfo, RedirectToLoginOptions, RedirectToSignupOptions, User, } from "@propelauth/javascript"; | ||
export { AuthProvider, RequiredAuthProvider } from "./AuthContext"; | ||
@@ -4,0 +4,0 @@ export type { AuthProviderProps, RequiredAuthProviderProps } from "./AuthContext"; |
import React from "react"; | ||
export declare function useRedirectFunctions(): { | ||
redirectToSignupPage: () => void; | ||
redirectToLoginPage: () => void; | ||
redirectToSignupPage: (options?: import("@propelauth/javascript").RedirectToSignupOptions | undefined) => void; | ||
redirectToLoginPage: (options?: import("@propelauth/javascript").RedirectToLoginOptions | undefined) => void; | ||
redirectToAccountPage: () => void; | ||
@@ -6,0 +6,0 @@ redirectToOrgPage: (orgId?: string | undefined) => void; |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"license": "MIT", | ||
@@ -17,3 +17,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@propelauth/javascript": "^1.2.4", | ||
"@propelauth/javascript": "^1.2.5", | ||
"hoist-non-react-statics": "^3.3.2", | ||
@@ -20,0 +20,0 @@ "utility-types": "^3.10.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
303306
3423