Skip to content

Commit

Permalink
Merge pull request #54 from gocardless/hmac/fix-access-token-auth
Browse files Browse the repository at this point in the history
Don't require authentication for creating access tokens
  • Loading branch information
Harry Maclean authored Aug 22, 2018
2 parents ff264bb + d67e595 commit f31b9a0
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Unreleased

Nothing

2.0.1
-----

- Fix bug where the `POST /access_tokens` route was behind authentication,
preventing users from authenticating for the first time.

2.0.0
-----

Expand Down
2 changes: 1 addition & 1 deletion DRAUPNIR_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.0.1
80 changes: 72 additions & 8 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,15 @@ func main() {
Add(routes.Authenticate(authenticator))

// Access Tokens
// This route is hit before the user is authenticated, so we don't use the
// Authenticate middleware
router.Methods("POST").Path("/access_tokens").HandlerFunc(
defaultChain.Resolve(accessTokenRouteSet.Create),
rootHandler.
Add(routes.DefaultErrorRenderer).
Add(routes.WithVersion).
Add(routes.AsJSON).
Add(routes.CheckAPIVersion(version.Version)).
Resolve(accessTokenRouteSet.Create),
)

// Images
Expand Down

0 comments on commit f31b9a0

Please sign in to comment.