import nookies from 'nookies' ; import Router from 'next/router' ; import { firebaseClient } from '../initializers/firebaseClient' ; const GoogleAuthProvider = new firebaseClient . auth . GoogleAuthProvider ( ) ; interface LoginOptions { redirect : string ; } export const login = async ( options ? ) => { try { await firebaseClient . auth ( ) . signInWithPopup ( GoogleAuthProvider ) ; if ( options ?. redirect ) { Router . push ( options . redirect ) ; } } catch ( error ) { console . error ( `[login] Error: ${ error . message }` ) ; } } ;