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