Link articlehistory to companyuser; store Google picture and sub on google_auth
This commit is contained in:
16
src/store/google_auth/setProfile.js
Normal file
16
src/store/google_auth/setProfile.js
Normal 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');
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user