[v0.0.2] Adds Google and Github OAuth2 Authentication

Adds to the API the feature of OAuth2 Authentication via two providers: Google and Github. For that the tests were updated.
This commit is contained in:
2022-11-10 01:03:32 -03:00
parent 0252695a7a
commit 9d93f04817
25 changed files with 514 additions and 149 deletions

View File

@@ -8,4 +8,14 @@ databaseChangeLog:
encoding: utf8
path: sqls/db-table-model-client.sql
relativeToChangelogFile: true
dbms: postgresql
dbms: postgresql
- changeSet:
id: adds-user-provider
author: vitor.h.n.batista@gmail.com
changes:
- sqlFile:
encoding: utf8
path: sqls/adds-user-provider.sql
relativeToChangelogFile: true
dbms: postgresql

View File

@@ -0,0 +1,14 @@
alter table if exists auth."user"
rename column "full_name" to "name";
ALTER TABLE IF EXISTS auth.user
ADD COLUMN IF NOT EXISTS provider VARCHAR
CHECK ( provider IN ('google', 'github', 'local') ) DEFAULT 'local' NOT NULL;
ALTER TABLE auth."user"
DROP CONSTRAINT IF EXISTS client_email_unique;
ALTER TABLE auth."user"
DROP CONSTRAINT IF EXISTS user_email_provider_unique;
ALTER TABLE auth."user"
ADD CONSTRAINT user_email_provider_unique UNIQUE (email, provider);