Skip to content

Commit

Permalink
Clean up login response model
Browse files Browse the repository at this point in the history
  • Loading branch information
josephspurrier committed May 21, 2019
1 parent d01b237 commit 89605c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/api/endpoint/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ func (p *LoginEndpoint) Login(w http.ResponseWriter, r *http.Request) (int, erro
}

// Create the response.
m := new(model.LoginResponse)
m.Body.Token = ""
m.Body.Status = http.StatusText(http.StatusOK)
m := new(model.LoginResponse).Body
m.Token = ""
m.Status = http.StatusText(http.StatusOK)

// Generate the access tokens.
m.Body.Token, err = p.Token.Generate(user.ID, 8*time.Hour)
m.Token, err = p.Token.Generate(user.ID, 8*time.Hour)
if err != nil {
return http.StatusInternalServerError, err
}

return p.Response.JSON(w, m.Body)
return p.Response.JSON(w, m)
}

0 comments on commit 89605c5

Please sign in to comment.