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,6 +1571,16 @@ function formatUserDate(iso: string): string {
|
|||||||
<!-- ── Account ── -->
|
<!-- ── Account ── -->
|
||||||
<div v-show="activeTab === 'account'" class="settings-grid">
|
<div v-show="activeTab === 'account'" class="settings-grid">
|
||||||
|
|
||||||
|
<!-- SSO accounts: no local credential management -->
|
||||||
|
<section v-if="!authStore.user?.has_password" class="settings-section">
|
||||||
|
<h2>Account</h2>
|
||||||
|
<p class="section-desc">
|
||||||
|
Your account is managed by an external identity provider.
|
||||||
|
Email and password changes are made through your provider, not here.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<template v-if="authStore.user?.has_password">
|
||||||
<section class="settings-section">
|
<section class="settings-section">
|
||||||
<h2>Email Address</h2>
|
<h2>Email Address</h2>
|
||||||
<p class="section-desc">Used for password resets and notifications.</p>
|
<p class="section-desc">Used for password resets and notifications.</p>
|
||||||
@@ -1591,7 +1594,7 @@ function formatUserDate(iso: string): string {
|
|||||||
class="input"
|
class="input"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="authStore.user?.has_password" class="field">
|
<div class="field">
|
||||||
<label for="email-password">Current Password</label>
|
<label for="email-password">Current Password</label>
|
||||||
<input
|
<input
|
||||||
id="email-password"
|
id="email-password"
|
||||||
@@ -1606,7 +1609,7 @@ function formatUserDate(iso: string): string {
|
|||||||
<button
|
<button
|
||||||
class="btn-save"
|
class="btn-save"
|
||||||
@click="changeEmail"
|
@click="changeEmail"
|
||||||
:disabled="changingEmail || (authStore.user?.has_password && !emailPassword)"
|
:disabled="changingEmail || !emailPassword"
|
||||||
>
|
>
|
||||||
{{ changingEmail ? "Saving..." : "Save Email" }}
|
{{ changingEmail ? "Saving..." : "Save Email" }}
|
||||||
</button>
|
</button>
|
||||||
@@ -1660,11 +1663,12 @@ function formatUserDate(iso: string): string {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</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