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

Regenerate access token #30

Merged
merged 9 commits into from Apr 11, 2017
Merged

Regenerate access token #30

merged 9 commits into from Apr 11, 2017

Conversation

amitaibu
Copy link
Member

@amitaibu amitaibu commented Apr 9, 2017

amitaibu_s_user_page

Confirmation form (to prevent CSRF)

regenerate_access_token

After submit, access token is replaced.

amitaibu_s_user_page

@@ -166,6 +166,7 @@ instance Yesod App where
isAuthorized (EditBidR _) _ = isAuthenticated
isAuthorized HomeR _ = isAuthenticated
isAuthorized ProfileR _ = isAuthenticated
isAuthorized (RegenerateAccessTokenR _) _ = isAuthenticated
Copy link
Member Author

Choose a reason for hiding this comment

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

replace this with isOwnerOrAdmin

Copy link
Member Author

Choose a reason for hiding this comment

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

#34

((result, widget), enctype) <- runFormPost $ confirmationForm userId
case result of
FormSuccess confirmation -> do
-- Update acceess token.
Copy link
Member Author

@amitaibu amitaibu Apr 9, 2017

Choose a reason for hiding this comment

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

move to a utility function along with the duplicated code in Foundation.hs

@amitaibu amitaibu changed the title WIP: Regenerate access token Regenerate access token Apr 11, 2017
We need to patch Yesod to add `AssertNoEq` in order to assert this test
@amitaibu
Copy link
Member Author

Created PR to Yesod.test to add assertNotEq - yesodweb/yesod#1375

@amitaibu amitaibu merged commit 6b16d05 into master Apr 11, 2017
@amitaibu amitaibu deleted the regenerate-token branch April 11, 2017 18:11
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.

None yet

1 participant