-
Notifications
You must be signed in to change notification settings - Fork 1
auth firebase HowTo
GitHub Action edited this page Apr 21, 2026
·
1 revision
This guide covers Firebase-specific auth operations.
Firebase allows attaching custom claims to a user's token (e.g., for roles). The adapter's verifyToken method will parse these and make them available in the normalized user object.
import { Auth } from '@quatrain/auth'
async function checkAdminStatus(token: string) {
const auth = Auth.getAdapter('firebase')
const user = await auth.verifyToken(token)
// User claims are exposed
if (user.claims && user.claims.admin) {
console.log('User is an admin')
} else {
console.log('Regular user')
}
}