mirror of
https://github.com/umami-software/umami.git
synced 2026-02-18 11:35:37 +01:00
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:
parent
1c4c97e02a
commit
610ca29cb5
11 changed files with 122 additions and 55 deletions
14
db/postgresql/migrations/14_add_auth_columns/migration.sql
Normal file
14
db/postgresql/migrations/14_add_auth_columns/migration.sql
Normal 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 $$;
|
||||
Loading…
Add table
Add a link
Reference in a new issue