Link articlehistory to companyuser; store Google picture and sub on google_auth
This commit is contained in:
@@ -271,6 +271,7 @@ const MENU = {
|
||||
{ value: 'google_auth.listAllowedEmails', label: 'listAllowedEmails', hint: '→ rows' },
|
||||
{ value: 'google_auth.removeAllowedEmail', label: 'removeAllowedEmail', hint: 'email' },
|
||||
{ value: 'google_auth.setSelectedCompany', label: 'setSelectedCompany', hint: 'googleAuthId, companyId' },
|
||||
{ value: 'google_auth.setProfile', label: 'setProfile', hint: 'googleAuthId, picture, sub' },
|
||||
],
|
||||
},
|
||||
schema: {
|
||||
@@ -1125,6 +1126,19 @@ async function runMethod(client, action) {
|
||||
await client.google_auth.setSelectedCompany(Number(id), Number(companyId));
|
||||
return ['ok', true];
|
||||
}
|
||||
case 'google_auth.setProfile': {
|
||||
const id = await askInt('Auth id');
|
||||
if (id == null) return;
|
||||
const picture = await askText('picture URL', { placeholder: '(empty = null)' });
|
||||
if (picture == null) return;
|
||||
const sub = await askText('Google sub', { placeholder: '(empty = null)' });
|
||||
if (sub == null) return;
|
||||
await client.google_auth.setProfile(Number(id), {
|
||||
picture: picture.trim() || null,
|
||||
sub: sub.trim() || null,
|
||||
});
|
||||
return ['ok', true];
|
||||
}
|
||||
case 'initialize': {
|
||||
await client.initialize();
|
||||
return ['ok', true];
|
||||
|
||||
Reference in New Issue
Block a user