auth

package
v0.0.0-...-9da9d5d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRefreshTokenValidity

func CheckRefreshTokenValidity(r *http.Request) (string, error)

func GenerateAccessToken

func GenerateAccessToken(rollNo string) (string, error)

func GenerateOtp

func GenerateOtp(rollNo string) error

func GenerateRefreshToken

func GenerateRefreshToken(rollNo string) (string, error)

func GetRollNoFromRequest

func GetRollNoFromRequest(r *http.Request) (string, error)

func GetRollNoFromTokenCookie

func GetRollNoFromTokenCookie(cookie *http.Cookie) (string, error)

func IsAuthorized

func IsAuthorized(endpoint func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)

func Login

func Login(rollNo string, password string) (ok bool, err error)

func ResetPassword

func ResetPassword(rollNo string, newPassword string, otp string) error

func Signup

func Signup(rollNo string, name string, password string, otp string) error

func VerifyOTP

func VerifyOTP(rollNo string, otp string) (err error)

Types

type Claims

type Claims struct {
	RollNo string `json:"rollNo"`
	jwt.RegisteredClaims
}

Jump to

Keyboard shortcuts

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