Skip to content

Refactor token creation #1061

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

Merged
merged 1 commit into from
Jan 16, 2018

Conversation

MaicolBen
Copy link
Collaborator

I didn't know if I should include @resource.save! in the new method, also method name suggestions are appreciated.

@KelseyDH
Copy link

KelseyDH commented Jan 10, 2018

@MaicolBen
Copy link
Collaborator Author

Thanks, but that applies to instance variables, you can't share two method variables unless you create a thread inside that method.

@zachfeldman
Copy link
Contributor

@MaicolBen sorry I haven't seen this yet! I approve of this line of thought and your changes. Fix your conflicts and we should be good to merge!

Copy link
Owner

@lynndylanhurley lynndylanhurley left a comment

Choose a reason for hiding this comment

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

Very nice. Thanks @MaicolBen!!

@MaicolBen MaicolBen force-pushed the refactor-create-token branch from 239d8f5 to 32fe65b Compare January 15, 2018 14:11
@Evan-M
Copy link
Collaborator

Evan-M commented Feb 21, 2018

Are the two instance methods in DeviseTokenAuth::Concern::User (#create_new_auth_token and #create_token) duplicate logic? Could they be refactored further to DRY up the logic?

Additionally, I would think that #build_auth_header and #update_auth_header in the DeviseTokenAuth::Concern::User model concern, are perhaps not a proper separation of concerns (MVC). Does a User model (or other Devise resource) need to know about request/response headers?

UPDATE: I realize that this comment is not as clear as I had intended. Thus I have created a new PR #1098.

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.

5 participants