Skip to content
This repository was archived by the owner on Apr 8, 2019. It is now read-only.

Assignment #4 - Basic authentication #120

Closed
wants to merge 7 commits into from

Conversation

hussainanjar
Copy link

Closes #118

@FennNaten
Copy link
Contributor

Hi,
I can see that you have the same failing test issue that I had. I don't want to spoil the fun of bug hunting, so I won't write the solution here, but if you're stuck and want help at some point, you can ask ;)
Also, sorry for the reference to your Pull Request that I made, I wanted to link the issue but failed to select the correct item in the suggestions -_-

@hussainanjar
Copy link
Author

@FennNaten help 😸

@FennNaten
Copy link
Contributor

^^ Just look at my latest commit on pr #121 ;) if you copy/pasted version.js as I did for private.js base, your next() call is not in the right place. You should move it into the callback of register(basic), otherwise it's called too soon ;)

return callback(null, false);
}

return callback(null, true, { user: user });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just pass the user object? Now you'll have to access it via request.auth.credentials.user instead of request.auth.credentials

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naturally it feels like like passing object is more useful, for instance if the user object had firstName and lastName or roles, i would get them with the object.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @AdriVanHoudt. The user key doesn't add much here.

@hueniverse hueniverse modified the milestone: 0.0.4 May 12, 2015
@hueniverse hueniverse closed this May 12, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Basic authentication
4 participants