Skip to content

Commit 32fcba0

Browse files
authored
Fix/forgot password (#430)
* fix: forgot password shown with magic link login * fix: forgot password shown with magic link login * fix is basic auth enabled
1 parent cac67b7 commit 32fcba0

File tree

8 files changed

+232
-76
lines changed

8 files changed

+232
-76
lines changed

app/package-lock.json

Lines changed: 17 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.15",
15+
"@authorizerdev/authorizer-react": "^1.1.18",
1616
"@types/react": "^17.0.15",
1717
"@types/react-dom": "^17.0.9",
1818
"esbuild": "^0.12.17",

app/src/pages/login.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,34 @@ const FooterContent = styled.div`
3232
export default function Login({ urlProps }: { urlProps: Record<string, any> }) {
3333
const { config } = useAuthorizer();
3434
const [view, setView] = useState<VIEW_TYPES>(VIEW_TYPES.LOGIN);
35+
const isBasicAuth = config.is_basic_authentication_enabled;
3536
return (
3637
<Fragment>
3738
{view === VIEW_TYPES.LOGIN && (
3839
<Fragment>
3940
<h1 style={{ textAlign: 'center' }}>Login</h1>
4041
<AuthorizerSocialLogin urlProps={urlProps} />
4142
<br />
42-
{config.is_basic_authentication_enabled &&
43+
{(config.is_basic_authentication_enabled ||
44+
config.is_mobile_basic_authentication_enabled) &&
4345
!config.is_magic_link_login_enabled && (
4446
<AuthorizerBasicAuthLogin urlProps={urlProps} />
4547
)}
4648
{config.is_magic_link_login_enabled && (
4749
<AuthorizerMagicLinkLogin urlProps={urlProps} />
4850
)}
49-
<Footer>
50-
<Link
51-
to="#"
52-
onClick={() => setView(VIEW_TYPES.FORGOT_PASSWORD)}
53-
style={{ marginBottom: 10 }}
54-
>
55-
Forgot Password?
56-
</Link>
57-
</Footer>
51+
{(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+
)}
5863
</Fragment>
5964
)}
6065
{view === VIEW_TYPES.FORGOT_PASSWORD && (
@@ -81,7 +86,7 @@ export default function Login({ urlProps }: { urlProps: Record<string, any> }) {
8186
!config.is_magic_link_login_enabled &&
8287
config.is_sign_up_enabled && (
8388
<FooterContent>
84-
Don't have an account? <Link to="/app/signup"> Sign Up</Link>
89+
Don't have an account? &nbsp; <Link to="/app/signup"> Sign Up</Link>
8590
</FooterContent>
8691
)}
8792
</Fragment>

app/yarn.lock

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22
# yarn lockfile v1
33

44

5-
"@authorizerdev/authorizer-js@^1.2.17":
6-
version "1.2.17"
7-
resolved "https://registry.npmjs.org/@authorizerdev/authorizer-js/-/authorizer-js-1.2.17.tgz"
8-
integrity sha512-aF/lu9wZR7TBRaRMAes/hy1q8cZzz5Zo60QLU9Iu09sqnhliHJCp5wSkjsVH+V4ER9i7bmJ2HNABTmOdluxj3A==
5+
"@authorizerdev/authorizer-js@^1.2.18":
6+
version "1.2.18"
7+
resolved "https://registry.npmjs.org/@authorizerdev/authorizer-js/-/authorizer-js-1.2.18.tgz"
8+
integrity sha512-9j5U/4lqaaEcG78Zli+TtLJ0migSKhFwnXXunulAGTZOzQSTCJ/CSSPip5wWNa/Mkr6gdEMwk1HYfhIdk2A9Mg==
99
dependencies:
1010
cross-fetch "^3.1.5"
1111

12-
"@authorizerdev/authorizer-react@^1.1.15":
13-
version "1.1.15"
14-
resolved "https://registry.npmjs.org/@authorizerdev/authorizer-react/-/authorizer-react-1.1.15.tgz"
15-
integrity sha512-Y71qC4GUAHL0QCNj5mVv0Jwv1cIg4Y0yXRiOeYV21C1NMleyLRXgw4qzJ/Vk8rmXsxqSHmr8SGrwOLcSKA2oMA==
12+
"@authorizerdev/authorizer-react@^1.1.18":
13+
version "1.1.18"
14+
resolved "https://registry.npmjs.org/@authorizerdev/authorizer-react/-/authorizer-react-1.1.18.tgz"
15+
integrity sha512-5SgFzG1VatmrMpl9XKwPcoVmCayA4Hn+sd2I9CwRlCWkdcna4pGJL8kYesuIGjGagS9394qp4ICRLRZ35wXj8A==
1616
dependencies:
17-
"@authorizerdev/authorizer-js" "^1.2.17"
17+
"@authorizerdev/authorizer-js" "^1.2.18"
18+
validator "^13.11.0"
1819

1920
"@babel/code-frame@^7.22.13":
2021
version "7.22.13"
@@ -594,6 +595,11 @@ typescript@^4.3.5:
594595
resolved "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz"
595596
integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==
596597

598+
validator@^13.11.0:
599+
version "13.11.0"
600+
resolved "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz"
601+
integrity sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==
602+
597603
value-equal@^1.0.1:
598604
version "1.0.1"
599605
resolved "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz"

server/graph/generated/generated.go

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

0 commit comments

Comments
 (0)