Skip to content

Commit

Permalink
social login related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
furknyavuz committed Jan 29, 2022
1 parent 0ca4aac commit 8e7c4ad
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/controller/social-login.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ export class SocialLoginController {
getAccessTokenDataForOauthV2 = async ( config: any, params: any ) => {
const headers = {
Accept: 'application/json',
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
};
const accessTokenParams = [
config.client_id,
Expand Down
4 changes: 2 additions & 2 deletions app/repository/social-login.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export class SocialLoginRepository {
] );

res = {
v1Config: v1.rowCount > 0 ? v1.rows[ 0 ] : null,
v2Config: v2.rowCount > 0 ? v2.rows[ 0 ] : null,
v1Config: v1.rowCount > 0 ? v1.rows[ 0 ] : undefined,
v2Config: v2.rowCount > 0 ? v2.rows[ 0 ] : undefined,
};
} catch ( error ) {
console.error( error );
Expand Down
14 changes: 13 additions & 1 deletion assets/sql/preload.tables.psql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ create TABLE IF NOT EXISTS social_logins

create TABLE IF NOT EXISTS oauth_v1_config_params
(
social_login_key text NOT NULL UNIQUE
social_login_key text NOT NULL UNIQUE,
client_id text NOT NULL,
client_secret text NOT NULL,
redirect_uri text NOT NULL,
login_uri text NOT NULL,
access_token_uri text NOT NULL,
access_token_query_param_field_path text NOT NULL,
user_data_uri text NOT NULL,
external_user_id_query_param_field_path text NOT NULL,
external_user_email_query_param_field_path text,
external_username_query_param_field_path text,
request_token_uri text NOT NULL,
access_token_request_method text NOT NULL
);

create TABLE IF NOT EXISTS oauth_v2_config_params
Expand Down

0 comments on commit 8e7c4ad

Please sign in to comment.