mirror of
https://github.com/HeyPuter/puter.git
synced 2026-07-30 19:01:18 +00:00
fix: ui signup order (#3385)
This commit is contained in:
@@ -511,6 +511,20 @@ function UIWindowSignup(options) {
|
||||
show_email_dialog
|
||||
) {
|
||||
$(el_window).close();
|
||||
// Verification gates run in order: email →
|
||||
// phone (SMS) → card, matching the server-side
|
||||
// order in assertVerifiedAccount.
|
||||
if (show_email_dialog) {
|
||||
email_verified =
|
||||
await UIWindowEmailConfirmationRequired({
|
||||
stay_on_top: true,
|
||||
has_head: true,
|
||||
reload_on_success:
|
||||
options.reload_on_success,
|
||||
window_options:
|
||||
options.window_options ?? {},
|
||||
});
|
||||
}
|
||||
if (data.user?.requires_phone_verification) {
|
||||
let phone_ok = false;
|
||||
do {
|
||||
@@ -527,17 +541,6 @@ function UIWindowSignup(options) {
|
||||
);
|
||||
} while (!phone_ok);
|
||||
}
|
||||
if (show_email_dialog) {
|
||||
email_verified =
|
||||
await UIWindowEmailConfirmationRequired({
|
||||
stay_on_top: true,
|
||||
has_head: true,
|
||||
reload_on_success:
|
||||
options.reload_on_success,
|
||||
window_options:
|
||||
options.window_options ?? {},
|
||||
});
|
||||
}
|
||||
// Card verification is the last gate.
|
||||
if (data.user?.requires_card_verification) {
|
||||
let card_ok = false;
|
||||
|
||||
+14
-11
@@ -1143,11 +1143,12 @@ window.initgui = async function (options) {
|
||||
}
|
||||
|
||||
if (whoami) {
|
||||
// is phone verification required? (hard gate for low-rep signups)
|
||||
if (whoami.requires_phone_verification) {
|
||||
// Verification gates run in order: email → phone (SMS) → card,
|
||||
// matching the server-side order in assertVerifiedAccount.
|
||||
if (whoami.requires_email_confirmation) {
|
||||
let is_verified;
|
||||
do {
|
||||
is_verified = await UIWindowPhoneVerificationRequired({
|
||||
is_verified = await UIWindowEmailConfirmationRequired({
|
||||
show_close_button: false,
|
||||
stay_on_top: true,
|
||||
has_head: false,
|
||||
@@ -1157,10 +1158,11 @@ window.initgui = async function (options) {
|
||||
});
|
||||
} while (!is_verified);
|
||||
}
|
||||
if (whoami.requires_email_confirmation) {
|
||||
// is phone verification required? (hard gate for low-rep signups)
|
||||
if (whoami.requires_phone_verification) {
|
||||
let is_verified;
|
||||
do {
|
||||
is_verified = await UIWindowEmailConfirmationRequired({
|
||||
is_verified = await UIWindowPhoneVerificationRequired({
|
||||
show_close_button: false,
|
||||
stay_on_top: true,
|
||||
has_head: false,
|
||||
@@ -1394,11 +1396,12 @@ window.initgui = async function (options) {
|
||||
}
|
||||
// update local user data
|
||||
if (whoami) {
|
||||
// is phone verification required? (hard gate for low-rep signups)
|
||||
if (whoami.requires_phone_verification) {
|
||||
// Verification gates run in order: email → phone (SMS) → card,
|
||||
// matching the server-side order in assertVerifiedAccount.
|
||||
if (whoami.requires_email_confirmation) {
|
||||
let is_verified;
|
||||
do {
|
||||
is_verified = await UIWindowPhoneVerificationRequired({
|
||||
is_verified = await UIWindowEmailConfirmationRequired({
|
||||
show_close_button: false,
|
||||
stay_on_top: true,
|
||||
has_head: false,
|
||||
@@ -1410,11 +1413,11 @@ window.initgui = async function (options) {
|
||||
});
|
||||
} while (!is_verified);
|
||||
}
|
||||
// is email confirmation required?
|
||||
if (whoami.requires_email_confirmation) {
|
||||
// is phone verification required? (hard gate for low-rep signups)
|
||||
if (whoami.requires_phone_verification) {
|
||||
let is_verified;
|
||||
do {
|
||||
is_verified = await UIWindowEmailConfirmationRequired({
|
||||
is_verified = await UIWindowPhoneVerificationRequired({
|
||||
show_close_button: false,
|
||||
stay_on_top: true,
|
||||
has_head: false,
|
||||
|
||||
Reference in New Issue
Block a user