Skip to content

Commit

Permalink
Validate Authorization transaction
Browse files Browse the repository at this point in the history
this also sets default values for missing fields.
  • Loading branch information
benpate committed Oct 17, 2023
1 parent 871fecf commit f4f41b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions handler/oauth-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ func PostOAuthAuthorization(serverFactory *server.Factory) echo.HandlerFunc {
return derp.Wrap(err, location, "Error loading OAuth Application")
}

// Validate the transaction
if err := transaction.Validate(application); err != nil {
return derp.Wrap(err, location, "Invalid transaction")
}

// Create a UserToken
userTokenService := factory.OAuthUserToken()
userToken, err := userTokenService.Create(application, authorization, transaction)
Expand Down

0 comments on commit f4f41b4

Please sign in to comment.