utils

package
v0.0.0-...-c193d7f Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(userPassword string, password string) bool

ComparePassword : compare the password

func HashPassword

func HashPassword(password string) (string, error)

HashPassword : hashing the password

func SignJWT

func SignJWT(userID *string) (*string, error)

SignJWT : func to generate JWT

func ValidateJWT

func ValidateJWT(tokenString *string) (*string, error)

ValidateJWT : func to parse JWT and to return the identity

Types

type Claims

type Claims struct {
	Sub   string
	Email string
	Name  string
}

func GoogleSignIn

func GoogleSignIn(ctx context.Context, idToken string) (*Claims, error)

type KakaoAccount

type KakaoAccount struct {
	Profile KakaoProfile `json:"profile"`
}

type KakaoProfile

type KakaoProfile struct {
	Nickname *string `json:"nickname"`
}

type KakaoTokenPayload

type KakaoTokenPayload struct {
	AccessToken string `json:"access_token"`
}

type KakaoUserInfo

type KakaoUserInfo struct {
	Id           uint `json:"id"`
	KakaoAccount `json:"kakao_account"`
}

func KakaoLogin

func KakaoLogin(code string) (*KakaoUserInfo, error)

Jump to

Keyboard shortcuts

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