sacsand / gofiber-firebaseauth Goto Github PK
View Code? Open in Web Editor NEWFirebase Authentication Middleware for Go Fiber framework.
License: MIT License
Firebase Authentication Middleware for Go Fiber framework.
License: MIT License
This is more likely my lack of understanding of how Go works than a gofiber-firebaseauth specific problem.
In the examples it shows accessing the claims object from context and printing it out.
claims := c.Locals("user")
fmt.Println(claims)
This works and I see this
{false mzeijVVkt6MDFQWmWBgzqr79taq2 [email protected]}
From looking at the source, it loads in the private user
struct into the context which is populated by fields from Token
from firebase. This results in a generic interface{}
for claims and I cannot figure out how to access each field, individually.
I looked into type assertion, reflection etc. but not sure what is needed here.
Thanks for the help.
I'm new in web developing.
In gofiberfirebaseauth.go line 45 "IDToken := c.Get(fiber.HeaderAuthorization)".
Can we get the IDToken from cookie value? instead.
Like in gofiber/jwt that you can select the method (jwtFromCookie(), jwtFromHeader()).
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),
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.