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() {
|
||||
@@ -1578,6 +1571,16 @@ function formatUserDate(iso: string): string {
|
||||
<!-- ── Account ── -->
|
||||
<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">
|
||||
<h2>Email Address</h2>
|
||||
<p class="section-desc">Used for password resets and notifications.</p>
|
||||
@@ -1591,7 +1594,7 @@ function formatUserDate(iso: string): string {
|
||||
class="input"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="authStore.user?.has_password" class="field">
|
||||
<div class="field">
|
||||
<label for="email-password">Current Password</label>
|
||||
<input
|
||||
id="email-password"
|
||||
@@ -1606,7 +1609,7 @@ function formatUserDate(iso: string): string {
|
||||
<button
|
||||
class="btn-save"
|
||||
@click="changeEmail"
|
||||
:disabled="changingEmail || (authStore.user?.has_password && !emailPassword)"
|
||||
:disabled="changingEmail || !emailPassword"
|
||||
>
|
||||
{{ changingEmail ? "Saving..." : "Save Email" }}
|
||||
</button>
|
||||
@@ -1660,11 +1663,12 @@ function formatUserDate(iso: string): string {
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<section class="settings-section">
|
||||
<h2>Active Sessions</h2>
|
||||
<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.
|
||||
</p>
|
||||
<div class="actions">
|
||||
@@ -2112,21 +2116,6 @@ function formatUserDate(iso: string): string {
|
||||
</div>
|
||||
</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 -->
|
||||
<section class="settings-section full-width">
|
||||
<h2>Scheduled Slots</h2>
|
||||
|
||||
Reference in New Issue
Block a user