removing auth dependency from shared authorized ui
This commit is contained in:
parent
9f02b47def
commit
0410a5ccae
3 changed files with 8 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { useAuth0 } from '@auth0/auth0-react';
|
||||
import { useAuthContext } from './authContext';
|
||||
|
||||
const LoginButton = () => {
|
||||
const { loginWithRedirect } = useAuth0();
|
||||
const { loginWithRedirect } = useAuthContext();
|
||||
|
||||
return (
|
||||
<button onClick={() => loginWithRedirect()}>
|
||||
|
|
@ -10,4 +10,4 @@ const LoginButton = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default LoginButton;
|
||||
export default LoginButton;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { useAuth0 } from "@auth0/auth0-react"
|
||||
import { RedirectLoginOptions, useAuth0 } from "@auth0/auth0-react"
|
||||
import { createContext, PropsWithChildren, useContext } from "react"
|
||||
|
||||
interface IAuthContext {
|
||||
isAuthenticated: boolean
|
||||
loginWithRedirect: () => void
|
||||
loginWithRedirect: (options?: RedirectLoginOptions) => void | Promise<void>
|
||||
logout: () => void
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue