- This addresses the problem of having to update multiple times during
one request. It's hard to have a nice interface especially with JWT
because you always end up having to decode the request, encode new
response, write header, then a second write to it comes, and where do
you grab the value from? Often you don't have access to the response
as a "read" structure. So we store it as events instead, and play
those events against the original data right before the response is
written to set the headers.
- Change response to be more central to Authboss. Make sure it has
useful methods and works with the new rendering idioms.
- Change the load user methods to all work with context keys, and even
be able to set context keys on the current request to avoid setting
contexts everywhere in the code base.
http.ListenAndServe requires two arguments, the second one can be nil,
but must be present. https://golang.org/pkg/net/http/#ListenAndServe
Omitting it, even in just documention code snippets like ths one,
might confuse people just learning (like myself).
This reverts commit 3b11e039dc, reversing
changes made to 586415a7db.
This merge actually caused the tests to fail. After digging in I decided
that the documentation is good enough as a test on creation of Authboss
is not possible with the current API. And this being only in the
register module was kind of a code smell.
- Fix#79
- Rename event EventGet to EventGetUser
- Remove double DB fetch
- Add new event callpoint: After(EventGetUser) for things that need to
check that the user is ABLE to be gotten after it's fetched from the
DB. That is before returning to the web app, ensure that the user is
valid from a confirmation/lock etc point of view.
- Add test to make sure all the events are firing in CurrentUser()
- When authboss routes are accessed it goes through a check to see if
they're logged in and if they need to actually visit this route. If
the user was not found (despite having a session cookie) it would 500,
and now it simply removes the bad cookie.
- Fix#75