feat(frontend): Refactor to cookie-based auth and add /api/v1 prefix
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { useState } from "react"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
|
||||
interface LoginFormProps {
|
||||
onSuccess: () => void
|
||||
@@ -45,6 +46,14 @@ export function LoginForm({ onSuccess, onToggleMode }: LoginFormProps) {
|
||||
}
|
||||
}
|
||||
|
||||
const handleOIDCLogin = async () => {
|
||||
try {
|
||||
await AuthService.loginWithOIDC()
|
||||
} catch (err) {
|
||||
setError("Failed to initialize SSO login.")
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Card className="w-full max-w-md mx-auto">
|
||||
<CardHeader>
|
||||
@@ -90,6 +99,20 @@ export function LoginForm({ onSuccess, onToggleMode }: LoginFormProps) {
|
||||
</Button>
|
||||
</form>
|
||||
</Form>
|
||||
|
||||
<div className="relative my-4">
|
||||
<div className="absolute inset-0 flex items-center">
|
||||
<Separator className="w-full" />
|
||||
</div>
|
||||
<div className="relative flex justify-center text-xs uppercase">
|
||||
<span className="bg-background px-2 text-muted-foreground">Or continue with</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button variant="outline" type="button" className="w-full" onClick={handleOIDCLogin}>
|
||||
Sign in with SSO
|
||||
</Button>
|
||||
|
||||
<div className="mt-4 text-center text-sm">
|
||||
Don't have an account?{" "}
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user