You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 29, 2021. It is now read-only.
This pull requests is in response to issue #11 . Definitely open to suggestions, but I've tested it in some other sample code outside the tests and it seems to work pretty well. Let me know!
This issue is a little tricky. First, there's the fact that FormLogin will consume the request body, so it won't play well with handlers that use ReqBody. Second, currently only JSON is allowed, which isn't quite what we want - form url encoded is quite likely also going to be used. Third, having application-specific authentication declared in instances isn't ideal, since often you need things like a database connection to do them, and doing that in instances isn't possible (or at least not in a pretty way).
My inclination is to make login the business of handlers that are outside of protected handlers. That said, #11 does show some issues with this. But I think if we provide a function addCookie that also provides the CSRF token, the interface will be usable enough. Then we can continue to use ReqBody for authentication credentials.
My take: servant-auth implement different sessions, while logging in with a form is an actual authentication method. Until we engineer authentication method API (and how it plays with sessions), it's not much use having it in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull requests is in response to issue #11 . Definitely open to suggestions, but I've tested it in some other sample code outside the tests and it seems to work pretty well. Let me know!