Feature/allow ominiauth_success json override#914
Feature/allow ominiauth_success json override#914thatandyrose wants to merge 4 commits intolynndylanhurley:masterfrom
Conversation
|
@lynndylanhurley any thoughts on this...? If it's not good we could close it, but would be great know why? Thanks! 👍 |
|
Hey @thatandyrose, sorry for the delay. There's a method in the For example, in my apps I've been doing something like this: # in app/models/user.rb
def token_validation_response
ActiveModelSerializers::SerializableResource.new(
self,
serializer: UserSerializer,
key_transform: :camel_lower
).as_json
endAnd that way the user model is serialized the same for sign_up, registration, and token validation. It looks like we should be using the same method for the omniauth response but we're not. Would it be possible to just change Thanks for taking the time to submit this : ) |
|
Hey @thatandyrose we'd love for you to finish this up if you have a moment! :) thanks again for your time. |
|
hey @lynndylanhurley and @zachfeldman sorry for the delay guys! Cool so shall I just make sure the ominauth controller is using that user concern method and then update the docs and we're good? Thanks for getting back and again sorry for the delay! cheers guys and gals! |
That would be amazing. Thanks 👍 |
Hi there!
While using
devise_token_authwithOmniauthI hit onto an issue where the user json being returned didn't match the schema used on my frontend vuejs app.I couldn't find an easy way to "hook" into the gem without forking and/or copying and pasting the
omniauth_successcontents, which I didn't want to do because of possible future breaking changes.I know there is a hook in there to pass a block, but if I somehow did that in there (like providing a proxy object or something)... it just feels wrong since it assumes knowledge of the underlying gem implementation.
Anyhow, this provide a simple method that can be overriden which is just for providing some way to serialize the resource object.
Yay 👍 or nay 👎 ?