Refactor authentication flow in LoginForm and LogoutPage to use next-auth. Remove unnecessary API calls and improve form handling. Update SSOPage to eliminate client token management. Adjust useApi hook to remove client token dependency.

This commit is contained in:
Robert Hajdu 2025-08-10 14:42:33 +02:00
parent 1c4c97e02a
commit 610ca29cb5
11 changed files with 122 additions and 55 deletions

View file

@ -0,0 +1,14 @@
-- Add optional email and email_verified to user table for Auth.js compatibility
ALTER TABLE "user"
ADD COLUMN IF NOT EXISTS email varchar(255),
ADD COLUMN IF NOT EXISTS email_verified timestamptz;
-- Ensure email is unique if present
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_indexes WHERE schemaname = current_schema() AND indexname = 'user_email_key'
) THEN
CREATE UNIQUE INDEX user_email_key ON "user" (email);
END IF;
END $$;