Store Google profile picture bytes on google_auth

This commit is contained in:
seb
2026-08-05 11:08:06 +02:00
parent d1eb2716ae
commit 561ba5bb99
9 changed files with 859 additions and 812 deletions

View File

@@ -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
`;