Documentation ¶
Overview ¶
Package firebase is common logic and handling around firebase.
Package firebase is common logic and handling around firebase.
Package firebase is common logic and handling around firebase.
Package firebase is common logic and handling around firebase.
Index ¶
- Variables
- type Client
- func (c *Client) ChangePasswordWithCode(ctx context.Context, code, newPassword string) (string, error)
- func (c *Client) SendEmailVerification(ctx context.Context, idToken string) error
- func (c *Client) SendNewUserInvitation(ctx context.Context, email string) error
- func (c *Client) VerifyPasswordResetCode(ctx context.Context, code string) (string, error)
- type ErrorDetails
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmailNotFound = &ErrorDetails{Err: "EMAIL_NOT_FOUND"} ErrInvalidOOBCode = &ErrorDetails{Err: "INVALID_OOB_CODE"} ErrExpiredOOBCode = &ErrorDetails{Err: "EXPIRED_OOB_CODE"} ErrCredentialTooOld = &ErrorDetails{Err: "CREDENTIAL_TOO_OLD_LOGIN_AGAIN"} ErrTokenExpired = &ErrorDetails{Err: "TOKEN_EXPIRED"} ErrInvalidToken = &ErrorDetails{Err: "INVALID_ID_TOKEN"} ErrTooManyAttempts = &ErrorDetails{Err: "TOO_MANY_ATTEMPTS_TRY_LATER"} )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ChangePasswordWithCode ¶
func (c *Client) ChangePasswordWithCode(ctx context.Context, code, newPassword string) (string, error)
ChangePasswordWithCode is called with the one-time-code given from a reset email to the user. When called with newPassword, it updates the user's password.
See: https://firebase.google.com/docs/reference/rest/auth#section-send-password-reset-email
func (*Client) SendEmailVerification ¶ added in v0.15.0
SendEmailVerification sends a message to verify the email address.
See: https://firebase.google.com/docs/reference/rest/auth#section-send-email-verification
func (*Client) SendNewUserInvitation ¶ added in v0.12.0
SendNewUserInvitation sends a password reset email to the user.
TODO(whaught): we're heading towards deprecating this in favor of directly sending our own email this currently sends password-reset and needs to be sending an invitation, but also may face rate-limiting on the firebase side if called too quickly.
See: https://firebase.google.com/docs/reference/rest/auth#section-send-password-reset-email
func (*Client) VerifyPasswordResetCode ¶
VerifyPasswordResetCode is called with the one-time-code given from a reset email to the user. It can be used to check that the code is valid without making changes to the user.
See: https://firebase.google.com/docs/reference/rest/auth#section-send-password-reset-email
type ErrorDetails ¶
ErrorDetails is the structure firebase gives back.
func (*ErrorDetails) Error ¶
func (err *ErrorDetails) Error() string
func (*ErrorDetails) Is ¶
func (err *ErrorDetails) Is(target error) bool
func (*ErrorDetails) ShouldReauthenticate ¶
func (err *ErrorDetails) ShouldReauthenticate() bool
ShouldReauthenticate returns true for errors that require a refreshed auth token.