Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to login using email and password using golang sdk #628

Open
vksssd opened this issue Jun 10, 2024 · 1 comment
Open

how to login using email and password using golang sdk #628

vksssd opened this issue Jun 10, 2024 · 1 comment

Comments

@vksssd
Copy link

vksssd commented Jun 10, 2024

how to login using email and password using golang sdk

[REQUIRED] : Want something similar to this

// EmailLoginHandler handles user login with email and password
func EmailLoginHandler(firebaseAuth *auth.Client) gin.HandlerFunc {
    return func(c *gin.Context) {
        var req EmailLoginRequest
        if err := c.ShouldBindJSON(&req); err != nil {
            utils.RespondWithError(c, http.StatusBadRequest, "Invalid request")
            return
        }

        // Authenticate user with email and password
        token, err := firebaseAuth.SignInWithEmailAndPassword(context.Background(), req.Email, req.Password)
        if err != nil {
            utils.RespondWithError(c, http.StatusUnauthorized, "Invalid email or password")
            return
        }

        c.JSON(http.StatusOK, gin.H{
            "message": "Login successful",
            "token":   token,
        })
    }
}

Method for signinwithemailandpassword is not available:

But SignInWithEmailAndPassword() is method is not available

@google-oss-bot
Copy link
Collaborator

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants