mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-10 20:11:49 +00:00
webapp: flow update password setting completely optional (#1578)
This commit is contained in:
1 parent
5d100a60e9
commit
ee4a7f7e2f
3 files changed
+7
-6
No files matched your search
@@ -87,11 +87,11 @@ export const SignupForm = ({
|
||||
|
||||
const handleGoogleSuccess = async () => {
|
||||
// Refresh so the session reflects the new cookie (and whether the account
|
||||
// still needs a password), then route accordingly. New SSO users with no
|
||||
// password go set one; everyone else goes home.
|
||||
// still needs a password), then route accordingly. New SSO users skip
|
||||
// setting a password and go straight to pricing; everyone else goes home.
|
||||
await refreshSession(true);
|
||||
if (useSessionStore.getState().passwordNotSet) {
|
||||
navigate("/set-password");
|
||||
navigate("/pricing");
|
||||
} else {
|
||||
navigate("/");
|
||||
}
|
||||
|
||||
@@ -51,13 +51,13 @@ export function SignupCtaModal() {
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
// Mirror the login/signup pages: refresh the session so it reflects the new
|
||||
// cookie, then send brand-new SSO users to set a password. Everyone else
|
||||
// cookie, then send brand-new SSO users straight to pricing. Everyone else
|
||||
// just closes the modal and stays on the page they were on.
|
||||
const handleGoogleSuccess = async () => {
|
||||
await refreshSession(true);
|
||||
close();
|
||||
if (useSessionStore.getState().passwordNotSet) {
|
||||
navigate("/set-password");
|
||||
navigate("/pricing");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -53,7 +53,8 @@ const Login = () => {
|
||||
// account still needs a password) before deciding where to send them.
|
||||
await refreshSession(true);
|
||||
if (useSessionStore.getState().passwordNotSet) {
|
||||
navigate("/set-password");
|
||||
// New SSO users skip setting a password and go straight to pricing.
|
||||
navigate("/pricing");
|
||||
} else {
|
||||
navigate(redirectTo);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user