Replaces the client-side PIN login with real authentication against Azure Entra ID via PocketBase's built-in OAuth2 (OIDC) flow. Every Azure user is auto-provisioned as a team_member on first login. - pb_migrations: team_members becomes a PocketBase auth collection (OIDC provider configured from env); all collections require @request.auth.id - pb_hooks: provisioning of role (ENTRA_ADMIN_EMAILS allow-list) and enrollment_status, with admin-role re-sync on every login - frontend: "Sign in with Microsoft" login, pb.authStore-based session, TeamManager manages roster/roles (no PIN/manual create) - infra: Entra env wiring + pb_hooks mount for dev (Labs) and prod - src/lib/azureAuth.js + tests for the canonical role/allow-list logic - docs/auth-spec.md Knowledge base, generated tests and micro-learnings are left untouched. Existing PIN users are dropped (no migration required, per sign-off). Closes #16 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
import js from '@eslint/js'
|
|
import globals from 'globals'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
|
|
export default defineConfig([
|
|
globalIgnores(['dist', 'pb_migrations', 'pb_hooks']),
|
|
{
|
|
files: ['**/*.{js,jsx}'],
|
|
extends: [
|
|
js.configs.recommended,
|
|
reactHooks.configs.flat.recommended,
|
|
reactRefresh.configs.vite,
|
|
],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
__BUILD_SHA__: 'readonly',
|
|
__BUILD_TIME__: 'readonly',
|
|
},
|
|
parserOptions: { ecmaFeatures: { jsx: true } },
|
|
},
|
|
rules: {
|
|
// Conventional initial-load pattern across the admin/chat surface;
|
|
// refactoring every effect is out of scope and not currently
|
|
// observed to cause cascading renders in practice.
|
|
'react-hooks/set-state-in-effect': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['src/store/AppContext.jsx'],
|
|
rules: {
|
|
'react-refresh/only-export-components': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['vite.config.js'],
|
|
languageOptions: { globals: { ...globals.node } },
|
|
},
|
|
{
|
|
files: ['src/lib/__tests__/**/*.{js,jsx}'],
|
|
languageOptions: { globals: { ...globals.node } },
|
|
},
|
|
])
|