Skip to content

Commit e521646

Browse files
Merge branch 'main' into fix/role-deletion
2 parents 7bcd5a7 + a63d00b commit e521646

38 files changed

+2676
-1888
lines changed

app/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"author": "Lakhan Samani",
1313
"license": "ISC",
1414
"dependencies": {
15-
"@authorizerdev/authorizer-react": "^1.1.19",
15+
"@authorizerdev/authorizer-react": "^1.2.0",
1616
"@types/react": "^17.0.15",
1717
"@types/react-dom": "^17.0.9",
1818
"esbuild": "^0.12.17",

app/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ export default function App() {
2727
if (redirectURL) {
2828
urlProps.redirectURL = redirectURL;
2929
} else {
30-
urlProps.redirectURL = window.location.origin + '/app';
30+
urlProps.redirectURL = window.location.href;
3131
}
3232
const globalState: Record<string, string> = {
3333
...window['__authorizer__'],
3434
...urlProps,
3535
};
36-
36+
console.log({ globalState });
3737
return (
3838
<div
3939
style={{

app/src/Root.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ export default function Root({
5959
useEffect(() => {
6060
if (token) {
6161
let redirectURL = config.redirectURL || '/app';
62-
let params = `access_token=${token.access_token}&id_token=${token.id_token}&expires_in=${token.expires_in}&state=${globalState.state}`;
62+
// let params = `access_token=${token.access_token}&id_token=${token.id_token}&expires_in=${token.expires_in}&state=${globalState.state}`;
63+
// Note: If OIDC breaks in the future, use the above params
64+
let params = `state=${globalState.state}`;
6365

6466
if (code !== '') {
6567
params += `&code=${code}`;

app/src/pages/login.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,18 @@ export default function Login({ urlProps }: { urlProps: Record<string, any> }) {
4949
<AuthorizerMagicLinkLogin urlProps={urlProps} />
5050
)}
5151
{(config.is_basic_authentication_enabled ||
52-
config.is_mobile_basic_authentication_enabled) && (
53-
<Footer>
54-
<Link
55-
to="#"
56-
onClick={() => setView(VIEW_TYPES.FORGOT_PASSWORD)}
57-
style={{ marginBottom: 10 }}
58-
>
59-
Forgot Password?
60-
</Link>
61-
</Footer>
62-
)}
52+
config.is_mobile_basic_authentication_enabled) &&
53+
!config.is_magic_link_login_enabled && (
54+
<Footer>
55+
<Link
56+
to="#"
57+
onClick={() => setView(VIEW_TYPES.FORGOT_PASSWORD)}
58+
style={{ marginBottom: 10 }}
59+
>
60+
Forgot Password?
61+
</Link>
62+
</Footer>
63+
)}
6364
</Fragment>
6465
)}
6566
{view === VIEW_TYPES.FORGOT_PASSWORD && (
@@ -70,6 +71,9 @@ export default function Login({ urlProps }: { urlProps: Record<string, any> }) {
7071
...urlProps,
7172
redirect_uri: `${window.location.origin}/app/reset-password`,
7273
}}
74+
onPasswordReset={() => {
75+
setView(VIEW_TYPES.LOGIN);
76+
}}
7377
/>
7478
<Footer>
7579
<Link

0 commit comments

Comments
 (0)