feat: Enable UGA SSO with Microsoft Entra
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import { supabase } from './lib/supabase'
|
||||
import { supabase, userManagement } from './lib/supabase'
|
||||
import { Login } from './components/Login'
|
||||
import { Dashboard } from './components/Dashboard'
|
||||
import { CameraRoute } from './components/CameraRoute'
|
||||
@@ -19,6 +19,13 @@ function App() {
|
||||
setIsAuthenticated(!!session)
|
||||
setLoading(false)
|
||||
|
||||
// Sync OAuth user on successful sign in (creates user profile if needed)
|
||||
if ((event === 'SIGNED_IN' || event === 'INITIAL_SESSION') && session) {
|
||||
userManagement.syncOAuthUser().catch((err) => {
|
||||
console.error('Failed to sync OAuth user:', err)
|
||||
})
|
||||
}
|
||||
|
||||
// Handle signout route
|
||||
if (event === 'SIGNED_OUT') {
|
||||
setCurrentRoute('/')
|
||||
|
||||
Reference in New Issue
Block a user