-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: show dialog when changing email after using Google Login #9611
Changes from all commits
9ad908b
d64cd8b
5e81e06
891ce0e
18200cd
eed01bb
18f14c5
9dc147f
5b28edc
b7d9baa
6b35724
62f6f76
ecc4c42
221c702
5833d3e
881598e
cc6dd39
97e8563
3330edb
8864163
3a02263
6f27c82
7dae85a
6333f8b
27f5927
6170e1c
036f33c
77e0bc2
ef03fa6
816b3c7
ff457b5
6c6c4c4
1677fe6
d380db8
4575627
8d99914
3976d88
5b1942c
6aefc6c
27920f6
9f2ce61
1bbd9da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import type { GetServerSidePropsContext } from "next"; | |
import { getCsrfToken } from "next-auth/react"; | ||
import { serverSideTranslations } from "next-i18next/serverSideTranslations"; | ||
import Link from "next/link"; | ||
import { useRouter } from "next/navigation"; | ||
import type { CSSProperties, SyntheticEvent } from "react"; | ||
import React from "react"; | ||
|
||
|
@@ -20,7 +19,6 @@ export default function ForgotPassword({ csrfToken }: { csrfToken: string }) { | |
const [error, setError] = React.useState<{ message: string } | null>(null); | ||
const [success, setSuccess] = React.useState(false); | ||
const [email, setEmail] = React.useState(""); | ||
const router = useRouter(); | ||
|
||
const handleChange = (e: SyntheticEvent) => { | ||
const target = e.target as typeof e.target & { value: string }; | ||
|
@@ -40,8 +38,6 @@ export default function ForgotPassword({ csrfToken }: { csrfToken: string }) { | |
const json = await res.json(); | ||
if (!res.ok) { | ||
setError(json); | ||
} else if ("resetLink" in json) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was needed for forgot-password E2E test but we don't rely on this anymore |
||
router.push(json.resetLink); | ||
} else { | ||
setSuccess(true); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,12 @@ export function Logout(props: Props) { | |
}, [props.query?.survey]); | ||
const { t } = useLocale(); | ||
|
||
const message = () => { | ||
if (props.query?.passReset === "true") return "reset_your_password"; | ||
if (props.query?.emailChange === "true") return "email_change"; | ||
return "hope_to_see_you_soon"; | ||
}; | ||
Comment on lines
+32
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More legible than a ternary if you ask me. No need for constants either. |
||
|
||
return ( | ||
<AuthContainer title={t("logged_out")} description={t("youve_been_logged_out")} showLogo> | ||
<div className="mb-4"> | ||
|
@@ -40,7 +46,7 @@ export function Logout(props: Props) { | |
{t("youve_been_logged_out")} | ||
</h3> | ||
<div className="mt-2"> | ||
<p className="text-subtle text-sm">{t("hope_to_see_you_soon")}</p> | ||
<p className="text-subtle text-sm">{t(message())}</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ | |
"event_awaiting_approval_recurring": "A recurring event is waiting for your approval", | ||
"someone_requested_an_event": "Someone has requested to schedule an event on your calendar.", | ||
"someone_requested_password_reset": "Someone has requested a link to change your password.", | ||
"password_reset_email_sent": "If this email exists in our system, you should receive a reset email.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restored the original message |
||
"password_reset_instructions": "If you didn't request this, you can safely ignore this email and your password will not be changed.", | ||
"event_awaiting_approval_subject": "Awaiting Approval: {{title}} at {{date}}", | ||
"event_still_awaiting_approval": "An event is still waiting for your approval", | ||
|
@@ -223,6 +224,10 @@ | |
"already_have_an_account": "Already have an account?", | ||
"create_account": "Create Account", | ||
"confirm_password": "Confirm password", | ||
"confirm_auth_change": "This will change the way you log in", | ||
"confirm_auth_email_change": "Changing the email address will disconnect your current authentication method to log in to Cal.com. We will ask you to verify your new email address. Moving forward, you will be logged out and use your new email address to log in instead of your current authentication method after setting your password by following the instructions that will be sent to your mail.", | ||
"reset_your_password": "Set your new password with the instructions sent to your email address.", | ||
"email_change": "Log back in with your new email address and password.", | ||
"create_your_account": "Create your account", | ||
"sign_up": "Sign up", | ||
"youve_been_logged_out": "You've been logged out", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to send a localized error message here. The client should handle it. Just double checked and we don't actually use this message in the frontend anyways.