Skip to content

Commit

Permalink
Refactor the way we query the URL Query params
Browse files Browse the repository at this point in the history
  • Loading branch information
supercairos committed Dec 5, 2023
1 parent 7ad3851 commit f99287b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions device_user_request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ func (f *Fosite) newDeviceUserRequest(ctx context.Context, r *http.Request) (Dev
request := NewDeviceUserRequest()
request.Lang = i18n.GetLangFromRequest(f.Config.GetMessageCatalog(ctx), r)

if err := r.ParseForm(); err != nil {
return nil, errorsx.WithStack(ErrInvalidRequest.WithHint("Unable to parse HTTP body, make sure to send a properly formatted form request body.").WithWrap(err).WithDebug(err.Error()))
}
request.Form = r.Form

verifier := request.GetRequestForm().Get("device_verifier")
verifier := r.URL.Query().Get("device_verifier")
if verifier != "" {
client, err := f.Store.GetClient(ctx, request.GetRequestForm().Get("client_id"))
client, err := f.Store.GetClient(ctx, r.URL.Query().Get("client_id"))
if err != nil {
return nil, errorsx.WithStack(ErrInvalidClient.WithHint("The requested OAuth 2.0 Client does not exist.").WithWrap(err).WithDebug(err.Error()))
}
Expand Down

0 comments on commit f99287b

Please sign in to comment.