gofiber-firebaseauth icon indicating copy to clipboard operation
gofiber-firebaseauth copied to clipboard

Trying to get `email` and `email_verified` even when `CheckEmailVerified: false` is set in Config which leads to `interface conversion: interface {} is nil, not string`

Open rafidkotta opened this issue 9 months ago • 0 comments

Trying to get email and email_verified even when CheckEmailVerified: false is set in Config which leads to interface conversion: interface {} is nil, not string

Error triggers when user does not have a email id (when using only phone auth)

// Set authenticated user data into local context
    c.Locals(cfg.ContextKey, User{
    Email:         token.Claims["email"].(string),
    EmailVerified: token.Claims["email_verified"].(bool),
    UserID:        token.Claims["user_id"].(string),
    })
Screenshot 2023-10-06 at 7 52 18 PM

rafidkotta avatar Oct 06 '23 15:10 rafidkotta