Show portal link for existing accounts even if never logged in
Previously required both has_account && returning (logged in before). Now shows portal link whenever has_account is true. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e76f54b11f
commit
af65fca709
1 changed files with 6 additions and 4 deletions
|
|
@ -87,8 +87,8 @@ Send reset link
|
||||||
fetch(API + "/api/v1/auth/portal-status?email=" + encodeURIComponent(email))
|
fetch(API + "/api/v1/auth/portal-status?email=" + encodeURIComponent(email))
|
||||||
.then(function(r) { return r.json(); })
|
.then(function(r) { return r.json(); })
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
if (data.has_account && data.returning) {
|
if (data.has_account) {
|
||||||
// Returning customer — hide password form, show welcome back
|
// Existing account — hide password form, show portal link
|
||||||
var form = document.getElementById("portal-password-form");
|
var form = document.getElementById("portal-password-form");
|
||||||
var already = document.getElementById("portal-already-set");
|
var already = document.getElementById("portal-already-set");
|
||||||
if (form) form.classList.add("hidden");
|
if (form) form.classList.add("hidden");
|
||||||
|
|
@ -97,8 +97,10 @@ Send reset link
|
||||||
already.innerHTML =
|
already.innerHTML =
|
||||||
'<div class="rounded-lg bg-blue-50 border border-blue-200 p-3 flex items-center gap-2 text-sm text-blue-800">' +
|
'<div class="rounded-lg bg-blue-50 border border-blue-200 p-3 flex items-center gap-2 text-sm text-blue-800">' +
|
||||||
'<svg class="w-4 h-4 text-blue-600 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"></path></svg>' +
|
'<svg class="w-4 h-4 text-blue-600 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"></path></svg>' +
|
||||||
'Welcome back' + (data.name ? ', ' + data.name.split(' ')[0] : '') + '! This order has been added to your portal. ' +
|
(data.returning
|
||||||
'<a href="https://portal.performancewest.net" class="underline font-medium hover:text-blue-900 ml-1">Log in to your portal →</a>' +
|
? 'Welcome back' + (data.name ? ', ' + data.name.split(' ')[0] : '') + '! This order has been added to your portal. '
|
||||||
|
: 'Your portal account is ready. ') +
|
||||||
|
'<a href="https://portal.performancewest.net" class="underline font-medium hover:text-blue-900 ml-1">Go to your portal →</a>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue