// LoginAction sends a JWT token on a success login request
LoginAction sends a JWT token on a success login request
// LoginAction sends a JWT token on a success login request
func (this UserController) LoginAction(c *gin.Context) {
	uReq := mrequest.UserLogin{}
	json.NewDecoder(c.Request.Body).Decode(&uReq)
	e := errors.ValidateRequest(&uReq)
	if e != nil {
		c.JSON(e.HttpCode, e)
		return
	}
	uRes, cookie, err := this.TokenService.GenerateToken(&uReq)
	if err != nil {
		c.JSON(err.HttpCode, err)
		return
	}
	http.SetCookie(c.Writer, cookie)
	c.JSON(200, uRes)
}
func ( this UserController ) LoginAction ( c * gin . Context ) { uReq := mrequest . UserLogin { } json . NewDecoder ( c . Request . Body ) . Decode ( & uReq ) e := errors . ValidateRequest ( & uReq ) if e != nil { c . JSON ( e . HttpCode , e ) return } uRes , cookie , err := this . TokenService . GenerateToken ( & uReq ) if err != nil { c . JSON ( err . HttpCode , err ) return } http . SetCookie ( c . Writer , cookie ) c . JSON ( 200 , uRes ) }
LoginAction sends a JWT token on a success login request
LoginAction sends a JWT token on a success login request