Store Google profile picture bytes on google_auth
This commit is contained in:
@@ -4,18 +4,30 @@ OUTPUT INSERTED.id
|
||||
VALUES (@email)
|
||||
`;
|
||||
|
||||
export const GET_BY_EMAIL = `
|
||||
SELECT
|
||||
export const GOOGLE_AUTH_COLUMNS = `
|
||||
id,
|
||||
email,
|
||||
picture,
|
||||
picturebinary AS pictureBinary,
|
||||
sub,
|
||||
created_at AS createdAt,
|
||||
selected_company AS selectedCompanyId
|
||||
`;
|
||||
|
||||
export const GET_BY_EMAIL = `
|
||||
SELECT
|
||||
${GOOGLE_AUTH_COLUMNS}
|
||||
FROM google_auth
|
||||
WHERE email = @email
|
||||
`;
|
||||
|
||||
export const GET_BY_ID = `
|
||||
SELECT
|
||||
${GOOGLE_AUTH_COLUMNS}
|
||||
FROM google_auth
|
||||
WHERE id = @googleAuthId
|
||||
`;
|
||||
|
||||
export const LIST_ALLOWED_EMAILS = `
|
||||
SELECT
|
||||
id,
|
||||
@@ -41,6 +53,6 @@ WHERE id = @googleAuthId
|
||||
|
||||
export const SET_PROFILE = `
|
||||
UPDATE google_auth
|
||||
SET picture = @picture, sub = @sub
|
||||
SET picture = @picture, picturebinary = @pictureBinary, sub = @sub
|
||||
WHERE id = @googleAuthId
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user