Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic authentication stuff #117

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

carlssonia
Copy link

To support user logging in snap-server (upcoming pull request).

@gregorycollins
Copy link
Member

Hi,

Re: the continuation passing style -- I think it's cleaner to do it that way, personally. When implementing this stuff, you are always going to need a function like:

checkBasicAuthenticationCredentials :: MonadSnap m => (ByteString, ByteString) -> m ()

If you just make the type

getBasicAuthenticationCredentials :: MonadSnap m => m (ByteString, ByteString)

then you are still going to need to check what they gave you somehow anyways. One of the reasons I like "with" style here is that it's clear to the user what he's expected to provide to use the API.

Another thing I'd say is that if we do it your way, you don't want the return type to be a "Maybe" here, just use mzero if the authentication process fails.

@meiersi
Copy link
Contributor

meiersi commented Apr 11, 2013

Hi @gregorycollins , I think this branch was accidentally closed because of my mistake in the in the issue number reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants