-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth): cleaned up reset password UI (#4671)
- Loading branch information
1 parent
3bef099
commit ee3ef81
Showing
8 changed files
with
129 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
export PHOENIX_SECRET=sa18f44bd9b6b4b0606e58a2d03d09039aee8283e0074c6517fda58577a07dd#A | ||
export PHOENIX_ENABLE_AUTH=True | ||
export PHOENIX_SMTP_HOSTNAME=smtp.sendgrid.net | ||
export PHOENIX_SMTP_PORT=587 | ||
export PHOENIX_SMTP_USERNAME=apikey | ||
export PHOENIX_SMTP_PASSWORD=XXXXXXXXXXXXXXXX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,67 @@ | ||
import React from "react"; | ||
import React, { useState } from "react"; | ||
import { css } from "@emotion/react"; | ||
|
||
import { Flex, View } from "@arizeai/components"; | ||
import { Flex, Heading } from "@arizeai/components"; | ||
|
||
import { Link } from "@phoenix/components"; | ||
|
||
import { AuthLayout } from "./AuthLayout"; | ||
import { ForgotPasswordForm } from "./ForgotPasswordForm"; | ||
import { PhoenixLogo } from "./PhoenixLogo"; | ||
|
||
export function ForgotPasswordPage() { | ||
const [resetSent, setResetSent] = useState<boolean>(false); | ||
const content = resetSent ? ( | ||
<Flex | ||
direction="column" | ||
alignItems="center" | ||
justifyContent="center" | ||
gap="size-100" | ||
> | ||
<Heading level={1}>Check your email</Heading> | ||
<p> | ||
{`Thanks! If an account with that email address exists, we sent you a link to reset your password.`} | ||
</p> | ||
</Flex> | ||
) : ( | ||
<> | ||
<Flex | ||
direction="column" | ||
alignItems="center" | ||
justifyContent="center" | ||
gap="size-100" | ||
> | ||
<Heading level={1}>Forgot Password</Heading> | ||
<p> | ||
{`Enter the email address associated with your account and we'll send you | ||
a link to reset your password.`} | ||
</p> | ||
</Flex> | ||
<ForgotPasswordForm onResetSent={() => setResetSent(true)} /> | ||
</> | ||
); | ||
return ( | ||
<AuthLayout> | ||
<Flex direction="column" gap="size-200" alignItems="center"> | ||
<View paddingBottom="size-200"> | ||
<PhoenixLogo /> | ||
</View> | ||
</Flex> | ||
<ForgotPasswordForm /> | ||
<div | ||
css={css` | ||
& a { | ||
text-align: center; | ||
width: 100%; | ||
display: block; | ||
text-align: center; | ||
padding-top: var(--ac-global-dimension-size-200); | ||
} | ||
`} | ||
> | ||
{content} | ||
<Flex | ||
direction="column" | ||
alignItems="center" | ||
justifyContent="center" | ||
gap="size-200" | ||
> | ||
<Link to="/login">Back to Login</Link> | ||
</Flex> | ||
</div> | ||
</AuthLayout> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
"HDBSCAN", | ||
"httpx", | ||
"Instrumentor", | ||
"instrumentors", | ||
"langchain", | ||
"litellm", | ||
"llamaindex", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,7 +300,7 @@ def get_env_smtp_password() -> str: | |
|
||
|
||
def get_env_smtp_mail_from() -> str: | ||
return os.getenv(ENV_PHOENIX_SMTP_MAIL_FROM) or "" | ||
return os.getenv(ENV_PHOENIX_SMTP_MAIL_FROM) or "[email protected]" | ||
|
||
|
||
def get_env_smtp_hostname() -> str: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Password Reset</title> | ||
</head> | ||
<body> | ||
<p>Hello.</p> | ||
<p>You have requested a password reset. Please click on the link below to reset your password:</p> | ||
<p> | ||
<a id="reset-url" href="{{ base_url }}/reset-password-with-token?token={{ token }}">Reset Password</a> | ||
</p> | ||
<p>If you did not make this request, please contact your administrator.</p> | ||
</body> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Password Reset</title> | ||
</head> | ||
<body> | ||
<p>Hello.</p> | ||
<p> | ||
You have requested a password reset. Please click on the link below to | ||
reset your password: | ||
</p> | ||
<p> | ||
<a | ||
id="reset-url" | ||
href="{{ base_url }}reset-password-with-token?token={{ token }}" | ||
>Reset Password</a | ||
> | ||
</p> | ||
<p>If you did not make this request, please contact your administrator.</p> | ||
</body> | ||
</html> |