Skip to content

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 #6

@rafidkotta

Description

@rafidkotta

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions