Files
dashlibstorage/API.google_auth.md
2026-08-07 04:05:01 +02:00

1.6 KiB

google_auth

This document is auto-generated from the JSDoc comments in src/store by running npm run api-doc.

google_auth.add

Source: src/store/google_auth/add.js

Adds a new allowed Google auth email.

const fn = add(pool);
const id = await fn('user@example.com');
// => 1

google_auth.getByEmail

Source: src/store/google_auth/getByEmail.js

Returns a Google auth row by email.

const fn = getByEmail(pool);
const auth = await fn('user@example.com');
// => { id, email, ... }

google_auth.getById

Source: src/store/google_auth/getById.js

Returns a Google auth row by its id.

const fn = getById(pool);
const auth = await fn(42);
// => { id, email, ... }

google_auth.listAllowedEmails

Source: src/store/google_auth/listAllowedEmails.js

Lists all allowed Google auth emails.

const fn = listAllowedEmails(pool);
const emails = await fn();
// => [{ id, email }]

google_auth.removeAllowedEmail

Source: src/store/google_auth/removeAllowedEmail.js

Removes an allowed Google auth email.

const fn = removeAllowedEmail(pool);
await fn('user@example.com');

google_auth.setProfile

Source: src/store/google_auth/setProfile.js

Updates the profile (picture, picture binary, sub) of a Google auth user.

const fn = setProfile(pool);
await fn(42, { picture: 'url', pictureBinary: buffer, sub: 'sub' });

google_auth.setSelectedCompany

Source: src/store/google_auth/setSelectedCompany.js

Sets the currently selected company for a Google auth user.

const fn = setSelectedCompany(pool);
await fn(42, 1);