redirecting to auth0 works with a button
This commit is contained in:
parent
0b29c7056a
commit
99ea402bad
2 changed files with 33 additions and 24 deletions
2
.env
2
.env
|
|
@ -1,4 +1,4 @@
|
||||||
#Auth0
|
#Auth0
|
||||||
VITE_AUTH0_CLIENT_DOMAIN=brandxtech.auth0.com
|
VITE_AUTH0_CLIENT_DOMAIN=brandxtech.auth0.com
|
||||||
VITE_AUTH0_AUDIENCE=pond.brandxtech.ca
|
VITE_AUTH0_AUDIENCE=pond.brandxtech.ca
|
||||||
VITE_AUTH0_BXT_CLIENT_ID=sLnqOu40uWfQT1lYSDYj2wYmlLEHRB74
|
VITE_AUTH0_BXT_CLIENT_ID=dzJTpqIeMA4Rwk4xujtwPbAO3TY32bM1
|
||||||
|
|
@ -4,6 +4,8 @@ import viteLogo from '/vite.svg'
|
||||||
import './App.css'
|
import './App.css'
|
||||||
import { Auth0Provider } from '@auth0/auth0-react'
|
import { Auth0Provider } from '@auth0/auth0-react'
|
||||||
import { or } from '../utils/types'
|
import { or } from '../utils/types'
|
||||||
|
import AuthWrapper from '../providers/auth'
|
||||||
|
import LoginButton from '../providers/LoginButton'
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const [count, setCount] = useState(0)
|
const [count, setCount] = useState(0)
|
||||||
|
|
@ -12,13 +14,16 @@ function App() {
|
||||||
let audience: string | undefined;
|
let audience: string | undefined;
|
||||||
if (window.location.origin === "https://staging.brandxtech.ca") {
|
if (window.location.origin === "https://staging.brandxtech.ca") {
|
||||||
url = import.meta.env.VITE_AUTH0_CLIENT_STAGING_DOMAIN;
|
url = import.meta.env.VITE_AUTH0_CLIENT_STAGING_DOMAIN;
|
||||||
audience = import.meta.env.REACT_APP_AUTH0_STAGING_AUDIENCE;
|
audience = import.meta.env.VITE_AUTH0_STAGING_AUDIENCE;
|
||||||
} else {
|
} else {
|
||||||
url = import.meta.env.REACT_APP_AUTH0_CLIENT_DOMAIN;
|
url = import.meta.env.VITE_AUTH0_CLIENT_DOMAIN;
|
||||||
audience = import.meta.env.REACT_APP_AUTH0_AUDIENCE;
|
audience = import.meta.env.VITE_AUTH0_AUDIENCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
let client_id = import.meta.env.REACT_APP_AUTH0_BXT_CLIENT_ID;
|
let client_id = import.meta.env.VITE_AUTH0_BXT_CLIENT_ID;
|
||||||
|
|
||||||
|
console.log(url)
|
||||||
|
console.log(audience)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Auth0Provider
|
<Auth0Provider
|
||||||
|
|
@ -29,26 +34,30 @@ function App() {
|
||||||
redirect_uri: window.location.origin + "/callback"
|
redirect_uri: window.location.origin + "/callback"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div>
|
{/* <AuthWrapper> */}
|
||||||
<a href="https://vitejs.dev" target="_blank">
|
<LoginButton/>
|
||||||
<img src={viteLogo} className="logo" alt="Vite logo" />
|
<div>
|
||||||
</a>
|
<a href="https://vitejs.dev" target="_blank">
|
||||||
<a href="https://react.dev" target="_blank">
|
<img src={viteLogo} className="logo" alt="Vite logo" />
|
||||||
<img src={reactLogo} className="logo react" alt="React logo" />
|
</a>
|
||||||
</a>
|
<a href="https://react.dev" target="_blank">
|
||||||
</div>
|
<img src={reactLogo} className="logo react" alt="React logo" />
|
||||||
<h1>Vite + React</h1>
|
</a>
|
||||||
<div className="card">
|
</div>
|
||||||
<button onClick={() => setCount((count) => count + 1)}>
|
<h1>Vite + React</h1>
|
||||||
count is {count}
|
<div className="card">
|
||||||
</button>
|
<button onClick={() => setCount((count) => count + 1)}>
|
||||||
<p>
|
count is {count}
|
||||||
The new Adaptive App
|
</button>
|
||||||
|
<p>
|
||||||
|
The new Adaptive App
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<p className="read-the-docs">
|
||||||
|
Coming soon
|
||||||
</p>
|
</p>
|
||||||
</div>
|
{/* </AuthWrapper> */}
|
||||||
<p className="read-the-docs">
|
|
||||||
Coming soon
|
|
||||||
</p>
|
|
||||||
</Auth0Provider>
|
</Auth0Provider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue