fix: ui signup order (#3385)
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled

This commit is contained in:
Daniel Salazar
2026-07-13 18:47:11 -07:00
committed by GitHub
parent c3368f553e
commit 3bf83d40e9
2 changed files with 28 additions and 22 deletions
+14 -11
View File
@@ -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
View File
@@ -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,