feat(settings): SSO account guard + remove redundant Office Days
- Account tab: SSO users see an info banner instead of email/password forms - Briefing tab: remove Office Days section (work days now come from Profile) - Remove unused toggleWorkDay function Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -347,13 +347,6 @@ async function geocodeLocation(key: 'home' | 'work') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleWorkDay(day: number) {
|
|
||||||
const days = briefingConfig.value.work_days;
|
|
||||||
const idx = days.indexOf(day);
|
|
||||||
if (idx === -1) days.push(day);
|
|
||||||
else days.splice(idx, 1);
|
|
||||||
days.sort();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
async function saveBriefingSettings() {
|
async function saveBriefingSettings() {
|
||||||
@@ -1578,93 +1571,104 @@ function formatUserDate(iso: string): string {
|
|||||||
<!-- ── Account ── -->
|
<!-- ── Account ── -->
|
||||||
<div v-show="activeTab === 'account'" class="settings-grid">
|
<div v-show="activeTab === 'account'" class="settings-grid">
|
||||||
|
|
||||||
<section class="settings-section">
|
<!-- SSO accounts: no local credential management -->
|
||||||
<h2>Email Address</h2>
|
<section v-if="!authStore.user?.has_password" class="settings-section">
|
||||||
<p class="section-desc">Used for password resets and notifications.</p>
|
<h2>Account</h2>
|
||||||
<div class="field">
|
<p class="section-desc">
|
||||||
<label for="new-email">Email</label>
|
Your account is managed by an external identity provider.
|
||||||
<input
|
Email and password changes are made through your provider, not here.
|
||||||
id="new-email"
|
</p>
|
||||||
v-model="newEmail"
|
|
||||||
type="email"
|
|
||||||
placeholder="you@example.com"
|
|
||||||
class="input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div v-if="authStore.user?.has_password" class="field">
|
|
||||||
<label for="email-password">Current Password</label>
|
|
||||||
<input
|
|
||||||
id="email-password"
|
|
||||||
v-model="emailPassword"
|
|
||||||
type="password"
|
|
||||||
autocomplete="current-password"
|
|
||||||
class="input"
|
|
||||||
/>
|
|
||||||
<p class="field-hint">Required to confirm the change.</p>
|
|
||||||
</div>
|
|
||||||
<div class="actions">
|
|
||||||
<button
|
|
||||||
class="btn-save"
|
|
||||||
@click="changeEmail"
|
|
||||||
:disabled="changingEmail || (authStore.user?.has_password && !emailPassword)"
|
|
||||||
>
|
|
||||||
{{ changingEmail ? "Saving..." : "Save Email" }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="settings-section">
|
<template v-if="authStore.user?.has_password">
|
||||||
<h2>Change Password</h2>
|
<section class="settings-section">
|
||||||
<div class="field">
|
<h2>Email Address</h2>
|
||||||
<label for="current-password">Current Password</label>
|
<p class="section-desc">Used for password resets and notifications.</p>
|
||||||
<input
|
<div class="field">
|
||||||
id="current-password"
|
<label for="new-email">Email</label>
|
||||||
v-model="currentPassword"
|
<input
|
||||||
type="password"
|
id="new-email"
|
||||||
autocomplete="current-password"
|
v-model="newEmail"
|
||||||
class="input"
|
type="email"
|
||||||
/>
|
placeholder="you@example.com"
|
||||||
</div>
|
class="input"
|
||||||
<div class="field">
|
/>
|
||||||
<label for="new-password">New Password</label>
|
</div>
|
||||||
<input
|
<div class="field">
|
||||||
id="new-password"
|
<label for="email-password">Current Password</label>
|
||||||
v-model="newPassword"
|
<input
|
||||||
type="password"
|
id="email-password"
|
||||||
autocomplete="new-password"
|
v-model="emailPassword"
|
||||||
class="input"
|
type="password"
|
||||||
/>
|
autocomplete="current-password"
|
||||||
<p class="field-hint">Must be at least 8 characters</p>
|
class="input"
|
||||||
</div>
|
/>
|
||||||
<div class="field">
|
<p class="field-hint">Required to confirm the change.</p>
|
||||||
<label for="confirm-new-password">Confirm New Password</label>
|
</div>
|
||||||
<input
|
<div class="actions">
|
||||||
id="confirm-new-password"
|
<button
|
||||||
v-model="confirmNewPassword"
|
class="btn-save"
|
||||||
type="password"
|
@click="changeEmail"
|
||||||
autocomplete="new-password"
|
:disabled="changingEmail || !emailPassword"
|
||||||
class="input"
|
>
|
||||||
:class="{ 'input-error': confirmNewPassword && newPassword !== confirmNewPassword }"
|
{{ changingEmail ? "Saving..." : "Save Email" }}
|
||||||
/>
|
</button>
|
||||||
<p v-if="confirmNewPassword && newPassword !== confirmNewPassword" class="error-hint">
|
</div>
|
||||||
Passwords do not match
|
</section>
|
||||||
</p>
|
|
||||||
</div>
|
<section class="settings-section">
|
||||||
<div class="actions">
|
<h2>Change Password</h2>
|
||||||
<button
|
<div class="field">
|
||||||
class="btn-save"
|
<label for="current-password">Current Password</label>
|
||||||
@click="changePassword"
|
<input
|
||||||
:disabled="changingPassword || !currentPassword || newPassword.length < 8 || newPassword !== confirmNewPassword"
|
id="current-password"
|
||||||
>
|
v-model="currentPassword"
|
||||||
{{ changingPassword ? "Changing..." : "Change Password" }}
|
type="password"
|
||||||
</button>
|
autocomplete="current-password"
|
||||||
</div>
|
class="input"
|
||||||
</section>
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label for="new-password">New Password</label>
|
||||||
|
<input
|
||||||
|
id="new-password"
|
||||||
|
v-model="newPassword"
|
||||||
|
type="password"
|
||||||
|
autocomplete="new-password"
|
||||||
|
class="input"
|
||||||
|
/>
|
||||||
|
<p class="field-hint">Must be at least 8 characters</p>
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label for="confirm-new-password">Confirm New Password</label>
|
||||||
|
<input
|
||||||
|
id="confirm-new-password"
|
||||||
|
v-model="confirmNewPassword"
|
||||||
|
type="password"
|
||||||
|
autocomplete="new-password"
|
||||||
|
class="input"
|
||||||
|
:class="{ 'input-error': confirmNewPassword && newPassword !== confirmNewPassword }"
|
||||||
|
/>
|
||||||
|
<p v-if="confirmNewPassword && newPassword !== confirmNewPassword" class="error-hint">
|
||||||
|
Passwords do not match
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
|
<button
|
||||||
|
class="btn-save"
|
||||||
|
@click="changePassword"
|
||||||
|
:disabled="changingPassword || !currentPassword || newPassword.length < 8 || newPassword !== confirmNewPassword"
|
||||||
|
>
|
||||||
|
{{ changingPassword ? "Changing..." : "Change Password" }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
<section class="settings-section">
|
<section class="settings-section">
|
||||||
<h2>Active Sessions</h2>
|
<h2>Active Sessions</h2>
|
||||||
<p class="section-desc">
|
<p class="section-desc">
|
||||||
Sign out all other devices and sessions. Use this after an SSO password change
|
Sign out all other devices and sessions. Use this after a password change
|
||||||
to ensure stale sessions are revoked.
|
to ensure stale sessions are revoked.
|
||||||
</p>
|
</p>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
@@ -2112,21 +2116,6 @@ function formatUserDate(iso: string): string {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Work schedule -->
|
|
||||||
<section class="settings-section full-width">
|
|
||||||
<h2>Office Days</h2>
|
|
||||||
<p class="section-desc">Which days do you go into the office? Used to decide whether to include the 8am check-in slot.</p>
|
|
||||||
<div class="briefing-day-toggles">
|
|
||||||
<button
|
|
||||||
v-for="(day, idx) in ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']"
|
|
||||||
:key="idx"
|
|
||||||
:class="['briefing-day-btn', { active: briefingConfig.work_days.includes(idx) }]"
|
|
||||||
@click="toggleWorkDay(idx)"
|
|
||||||
type="button"
|
|
||||||
>{{ day }}</button>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<!-- Slots -->
|
<!-- Slots -->
|
||||||
<section class="settings-section full-width">
|
<section class="settings-section full-width">
|
||||||
<h2>Scheduled Slots</h2>
|
<h2>Scheduled Slots</h2>
|
||||||
|
|||||||
Reference in New Issue
Block a user