async signInWithGoogle({ request, response }: HttpContext) {
const { data, error } = await this.auth.signInWithOAuth({
provider: 'google',
options: {
queryParams: {
access_type: 'offline',
prompt: 'consent',
},
},
})
if (error) {
return response.status(400).json({ error: error.message })
}
return response.redirect().toPath(data.url)
}
async signInWithGoogle({ request, response }: HttpContext) {
const { data, error } = await this.auth.signInWithOAuth({
provider: 'google',
options: {
queryParams: {
access_type: 'offline',
prompt: 'consent',
},
},
})
if (error) {
return response.status(400).json({ error: error.message })
}
return response.redirect().toPath(data.url)
}