authentication

package
v0.0.0-...-7544200 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FacebookAuth

func FacebookAuth(accessToken string, userId string) (interface{}, error)

func GenerateJWT

func GenerateJWT(user interface{}) (string, error)

TODO: are tokens validated against their expiry date?

func GetHttpJson

func GetHttpJson(url string, target interface{}) error

func HashPassword

func HashPassword(password string) ([]uint8, error)

func LoginAdminUser

func LoginAdminUser(email string, password string) (interface{}, error)

func LoginUser

func LoginUser(email string, password string) (interface{}, error)

func RegisterUser

func RegisterUser(name string, email string, password string, isFacebook bool) (interface{}, error)

Types

type FacebookMe

type FacebookMe struct {
	Id      string      `json:"id"`
	Name    string      `json:"name"`
	Email   string      `json:"email"`
	Picture PictureData `json:"picture"`
}

type Picture

type Picture struct {
	Height int    `json:"height"`
	Url    string `json:"url"`
	Width  int    `json:"width"`
}

type PictureData

type PictureData struct {
	Data Picture `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳