-
Notifications
You must be signed in to change notification settings - Fork 86
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
Implement SetTimberUserContext plug #1101
Conversation
a0244b8
to
ce0c621
Compare
@begedin would you mind giving this a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well tested and more explicit than what we have. Looks good to me.
There are some conflicts here now, though. We've upgraded Guardian. @teerawat1992 is it possible for you to deconflict the changes and bring them into the newly updated Guardian code? |
@joshsmith Sure, I'll deconflict the changes 🙇 |
Remove unused pattern matching functions.
SetTimberUserContext is already defined inside router.ex
Place it in "Web – Plugs" list.
ce0c621
to
ca3141f
Compare
@joshsmith @begedin I've rebased from develop branch and refactored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the typo is cleared, I'm fine with merging this in.
changeset = User.changeset(%User{}, @valid_attrs) | ||
assert changeset.valid? | ||
describe "full_name/1" do | ||
test "returns full name correclty" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got a typo here, sorry 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops 😅
Change 'correclty' to 'correctly'.
🙌 great work @teerawat1992! |
What's in this PR?
CodeCorpsWeb.Plug.SetTimberUserContext
plug module.User.full_name/1
function.CodeCorpsWeb.GuardianSerializer
module.CodeCorpsWeb.Plug.SetTimberUserContext
module to::current_user
pipeline.References
Fixes #932