auth

package
v0.0.0-...-5e0b955 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func HashPassword

func HashPassword(password string) (string, error)

func Heartbeat

func Heartbeat(w http.ResponseWriter, r *http.Request)

func RefreshToken

func RefreshToken(w http.ResponseWriter, r *http.Request)

@Summary 토큰 갱신 @Description 토큰 갱신 @Tags Auth tag @Accept json @Produce json @Param authorization header string true "jwt token" @Success 200 {object} authdto.RefreshTokenResponseDTO "success" @Failure 400 {object} types.ErrorResponse "입력값이 유효하지 않음" @Failure 500 {object} types.ErrorResponse "network error" @Router /user/{user_id}/refresh [get]

func SignIn

func SignIn(w http.ResponseWriter, r *http.Request)

@Summary 로그인 @Description 로그인 @Tags Auth tag @Accept json @Produce json @Param signInReq body authdto.SignInRequestDTO true "signInReq" @Success 200 {object} authdto.SignInResponseWrapperDTO "로그인 성공" @Failure 400 {object} types.ErrorResponse "입력값이 유효하지 않음" @Failure 422 {object} types.ErrorResponse "유저가 존재하지 않거나 비밀번호가 틀림" @Failure 500 {object} types.ErrorResponse "network error" @Router /user/signin [post]

func SignUp

func SignUp(w http.ResponseWriter, r *http.Request)

@Summary 회원가입 @Description 회원가입 @Tags Auth tag @Accept json @Produce json @Param signUpReq body authdto.SignUpRequestDTO true "signUpReq" @Success 201 {object} authdto.SignUpResponseWrapperDTO "success" @Failure 400 {object} types.ErrorResponse "입력값이 유효하지 않음" @Failure 422 {object} types.ErrorResponse "이미 존재하는 계정" @Router /user/signup [post]

func SignUpDTOToUser

func SignUpDTOToUser(requestDTO authdto.SignUpRequestDTO, hashedPassword string) models.User

func UserToSignInResponseDTO

func UserToSignInResponseDTO(user models.User, token string) (string, error)

func ValidateSignInRequestDTO

func ValidateSignInRequestDTO(requestDTO authdto.SignInRequestDTO) error

func ValidateSignUpRequestDTO

func ValidateSignUpRequestDTO(requestDTO authdto.SignUpRequestDTO) error

func ValidateVerifyEmailRequestDTO

func ValidateVerifyEmailRequestDTO(requestDTO authdto.VerifyEmailRequestDTO) error

func ValidateVerifyUsernameRequestDTO

func ValidateVerifyUsernameRequestDTO(requestDTO authdto.VerifyUsernameRequestDTO) error

func VerifyEmail

func VerifyEmail(w http.ResponseWriter, r *http.Request)

@Summary 이메일 중복 확인 @Description 이메일 중복 확인 @Tags Auth tag @Accept json @Produce json @Param verifyEmailReq body authdto.VerifyEmailRequestDTO true "verifyEmailReq" @Success 200 {object} authdto.VerifyEmailResponseDTO "success" @Failure 400 {object} types.ErrorResponse "입력값이 유효하지 않거나 이메일 형식이 아님" @Failure 409 {object} types.ErrorResponse "이미 존재하는 email" @Failure 500 {object} types.ErrorResponse "network error" @Router /user/verify-email [post]

func VerifyUsername

func VerifyUsername(w http.ResponseWriter, r *http.Request)

@Summary 유저네임 중복 확인 @Description 유저네임 중복 확인 @Tags Auth tag @Accept json @Produce json @Param verifyUsernameReq body authdto.VerifyUsernameRequestDTO true "verifyUsernameReq" @Success 200 {object} authdto.VerifyUsernameResponseDTO "success" @Failure 400 {object} types.ErrorResponse "입력값이 유효하지 않음" @Failure 409 {object} types.ErrorResponse "이미 존재하는 username" @Failure 500 {object} types.ErrorResponse "network error" @Router /user/verify-username [post]

Types

This section is empty.

Jump to

Keyboard shortcuts

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