Skip to content

Commit

Permalink
feat(oauth): association userID with clientID (clean)
Browse files Browse the repository at this point in the history
  • Loading branch information
blancinot committed Oct 8, 2019
1 parent fffcef8 commit 87ab170
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,14 @@ func (api *API) oauthAuthenticate(request *restful.Request, response *restful.Re
}
_, tokenString, err := api.createToken(user, claims)
if err != nil {
panic(err)
response.WriteError(http.StatusUnprocessableEntity, fmt.Errorf("Not possible to create valid token: %s", err.Error()))
return
}

_, err = api.checkToken(tokenString)
if err != nil {
panic(err)
response.WriteError(http.StatusUnprocessableEntity, fmt.Errorf("Not valid token after creation: %s", err.Error()))
return
}

response.WriteEntity(&AuthResponse{tokenString, claims})
Expand Down

0 comments on commit 87ab170

Please sign in to comment.