21 lines
514 B
JavaScript
21 lines
514 B
JavaScript
import { REMOVE_ALLOWED_EMAIL } from '../../sql/google_auth.js';
|
|
|
|
/**
|
|
* Removes an allowed Google auth email.
|
|
*
|
|
* @param {object} pool - The mssql connection pool.
|
|
* @returns {Function} An async function that removes an allowed email.
|
|
*
|
|
* @example
|
|
* const fn = removeAllowedEmail(pool);
|
|
* await fn('user@example.com');
|
|
*/
|
|
export default function removeAllowedEmail(pool) {
|
|
return async (email) => {
|
|
await pool
|
|
.request()
|
|
.input('email', email)
|
|
.query(REMOVE_ALLOWED_EMAIL);
|
|
};
|
|
}
|