Link articlehistory to companyuser; store Google picture and sub on google_auth

This commit is contained in:
seb
2026-08-05 10:57:50 +02:00
parent 46c85fe29e
commit d1eb2716ae
12 changed files with 1284 additions and 1191 deletions

View File

@@ -0,0 +1,16 @@
import { SET_PROFILE } from '../../sql/google_auth.js';
export default function setProfile(pool) {
return async (googleAuthId, { picture = null, sub = null } = {}) => {
const result = await pool
.request()
.input('googleAuthId', googleAuthId)
.input('picture', picture)
.input('sub', sub)
.query(SET_PROFILE);
if (!result.rowsAffected[0]) {
throw new Error('User not found');
}
};
}