auth

package
v0.0.0-...-47c56e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	App *firebase.Firebase
}

Auth has all the functions for authentication

func CreateAuth

func CreateAuth(app *firebase.Firebase) *Auth

CreateAuth creates an Auth struct with the supplied app

func (*Auth) RefreshTokenToIDToken

func (a *Auth) RefreshTokenToIDToken(refreshToken string) (*User, error)

RefreshTokenToIDToken allows you to exchange a refresh token for an ID token

func (*Auth) ResetPassword

func (a *Auth) ResetPassword(email string) error

ResetPassword allows you to send a password reset email to a user with a certain email

func (*Auth) SignInWithCustomToken

func (a *Auth) SignInWithCustomToken(token string) (*User, error)

SignInWithCustomToken allows you to exchange a custom Auth token for an ID and refresh token

func (*Auth) SignInWithEmailAndPassword

func (a *Auth) SignInWithEmailAndPassword(email string, password string) (*User, error)

SignInWithEmailAndPassword lets you sign in a user with a specified email and password

func (*Auth) SignUpWithEmailAndPassword

func (a *Auth) SignUpWithEmailAndPassword(email string, password string) (*User, error)

SignUpWithEmailAndPassword lets you create a user with a specified email and password

type OtherData

type OtherData struct {
	Email      string
	LocalID    string
	TokenType  string
	UserID     string
	ProjectID  string
	Registered bool
}

OtherData contains all possible other data

type User

type User struct {
	IDToken      string
	RefreshToken string
	ExpiresIn    time.Duration

	OtherData OtherData
}

User has the response data of Auth requests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL