forked from fa/breadcrumb-the-shire
Finalize init defaults and auth flow UX improvements
This commit is contained in:
@@ -14,6 +14,7 @@ $authHelpContext = [
|
||||
'show_back_to_login' => true,
|
||||
'show_support' => true,
|
||||
];
|
||||
$authLogoHref = lurl('login');
|
||||
?>
|
||||
|
||||
<article class="login-card">
|
||||
|
||||
@@ -33,6 +33,7 @@ $selectedTenantInitial = strtoupper(substr($selectedTenantLabel, 0, 1));
|
||||
if ($selectedTenantInitial === '') {
|
||||
$selectedTenantInitial = '?';
|
||||
}
|
||||
$canSwitchTenant = count($tenantCandidates) > 1;
|
||||
$errors = is_array($errors ?? null) ? $errors : [];
|
||||
$errorNoticeId = $errors ? 'auth-login-error-notice' : '';
|
||||
$loginHeading = t('Login');
|
||||
@@ -53,6 +54,10 @@ if ($stage === 'resolve_email') {
|
||||
'show_support' => true,
|
||||
];
|
||||
}
|
||||
$authLogoHref = lurl('login');
|
||||
if ($tenantHint !== '') {
|
||||
$authLogoHref .= '?tenant=' . rawurlencode($tenantHint);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -140,25 +145,30 @@ if ($stage === 'resolve_email') {
|
||||
<?php Session::getCsrfInput(); ?>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<section class="login-tenant-context" role="status" aria-live="polite">
|
||||
<div class="login-tenant-context-main">
|
||||
<?php if ($selectedTenantAvatarUrl !== ''): ?>
|
||||
<img class="login-tenant-context-avatar" src="<?php e($selectedTenantAvatarUrl); ?>" alt="" loading="lazy">
|
||||
<?php else: ?>
|
||||
<span class="login-tenant-context-avatar-placeholder"><?php e($selectedTenantInitial); ?></span>
|
||||
<?php endif; ?>
|
||||
<div class="login-tenant-context-text">
|
||||
<p class="login-tenant-context-name"><?php e($selectedTenantLabel); ?></p>
|
||||
<?php $hasSelectedTenantAvatar = $selectedTenantAvatarUrl !== ''; ?>
|
||||
<?php if ($canSwitchTenant): ?>
|
||||
<section class="login-tenant-context" role="status" aria-live="polite">
|
||||
<div class="login-tenant-context-main">
|
||||
<?php if ($hasSelectedTenantAvatar): ?>
|
||||
<img class="login-tenant-context-avatar" src="<?php e($selectedTenantAvatarUrl); ?>" alt="" loading="lazy">
|
||||
<?php else: ?>
|
||||
<span class="login-tenant-context-avatar-placeholder login-tenant-context-avatar-placeholder--name"><?php e($selectedTenantLabel); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($hasSelectedTenantAvatar): ?>
|
||||
<div class="login-tenant-context-text">
|
||||
<p class="login-tenant-context-name"><?php e($selectedTenantLabel); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<form method="post" class="login-tenant-context-form">
|
||||
<input type="hidden" name="stage" value="resolve_email">
|
||||
<input type="hidden" name="email" value="<?php e($email); ?>">
|
||||
<input type="hidden" name="tenant_hint" value="<?php e($tenantHint); ?>">
|
||||
<button type="submit" class="secondary outline small"><?php e(t('Switch tenant')); ?></button>
|
||||
<?php Session::getCsrfInput(); ?>
|
||||
</form>
|
||||
</section>
|
||||
<form method="post" class="login-tenant-context-form">
|
||||
<input type="hidden" name="stage" value="resolve_email">
|
||||
<input type="hidden" name="email" value="<?php e($email); ?>">
|
||||
<input type="hidden" name="tenant_hint" value="<?php e($tenantHint); ?>">
|
||||
<button type="submit" class="secondary outline small"><?php e(t('Switch tenant')); ?></button>
|
||||
<?php Session::getCsrfInput(); ?>
|
||||
</form>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="login-methods-stack">
|
||||
<?php if (!empty($selectedTenantMethods['microsoft']) && $selectedTenantSlug !== ''): ?>
|
||||
|
||||
@@ -21,6 +21,7 @@ $authHelpContext = [
|
||||
'show_back_to_login' => true,
|
||||
'show_support' => true,
|
||||
];
|
||||
$authLogoHref = lurl('login');
|
||||
?>
|
||||
<article class="login-card">
|
||||
<?php require templatePath('partials/auth-logo.phtml'); ?>
|
||||
|
||||
@@ -16,6 +16,7 @@ $authHelpContext = [
|
||||
'show_back_to_login' => true,
|
||||
'show_support' => true,
|
||||
];
|
||||
$authLogoHref = lurl('login');
|
||||
?>
|
||||
|
||||
<article class="login-card">
|
||||
|
||||
@@ -15,6 +15,7 @@ $authHelpContext = [
|
||||
'show_back_to_login' => true,
|
||||
'show_support' => true,
|
||||
];
|
||||
$authLogoHref = lurl('login');
|
||||
?>
|
||||
|
||||
<article class="login-card">
|
||||
|
||||
@@ -15,6 +15,7 @@ $authHelpContext = [
|
||||
'show_back_to_login' => true,
|
||||
'show_support' => true,
|
||||
];
|
||||
$authLogoHref = lurl('login');
|
||||
?>
|
||||
|
||||
<article class="login-card">
|
||||
|
||||
Reference in New Issue
Block a user