import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useApp } from '../store/AppContext'; import Card from '../components/ui/Card'; import Button from '../components/ui/Button'; const Login = () => { const { loginWithAzure } = useApp(); const navigate = useNavigate(); const [error, setError] = useState(''); const [busy, setBusy] = useState(false); const handleAzure = async () => { setError(''); setBusy(true); try { await loginWithAzure(); navigate('/'); } catch (e) { // PocketBase throws when the popup is closed or the token exchange fails. setError(e?.message || 'Signing in with Microsoft failed. Please try again.'); setBusy(false); } }; return (
Learning Platform
Sign in with your Respellion Microsoft account.
{error &&