auth

package
v0.0.0-...-687c1ae Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Login

func Login(c *gin.Context)

Login handles login request, receiving username/email and password from request body and verify it

func Logout

func Logout(c *gin.Context)

Logout handles logout request, revoking user's AccessToken and RefreshToken

func ResetPassword

func ResetPassword(c *gin.Context)

ResetPassword reset password of user

func SendResetToken

func SendResetToken(c *gin.Context)

SendResetToken sends reset password token to user's email

Types

type AuthLoginRequest

type AuthLoginRequest struct {
	// in:body
	Email    string `json:"email"`
	Username string `json:"username"`
	Password string `json:"password"`
}

swagger:parameters LoginCredencials

type AuthLoginResponse

type AuthLoginResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

swagger:response AuthLoginResponse

type AuthResetPasswordRequest

type AuthResetPasswordRequest struct {
	Token string `json:"token"`
}

swagger:parameters ResetPasswordRequest

type AuthResetTokenRequest

type AuthResetTokenRequest struct {
	Email string `json:"email"`
}

swagger:parameters ResetTokenRequest

Jump to

Keyboard shortcuts

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