You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My Rails app has an api and html views. I make the difference using the json formats. Will it be possible to mix both authentication strategies somehow in the same controller? If the format is json return json, otherwise html, and always return the token, or otherwise return it only if the format is json. The other option would be to have a separate controller for api and html, but this doesn't sound so nice.
What do you think? Thanks!
The text was updated successfully, but these errors were encountered:
Good point, I love this approach too (shared controllers), the problem is I'll need to maintain 3 different templates html/api/mixed. You will need to do it your self, your can use the same models and views but the controllers must be changed, you will need to implement something like:
Oh, I understand. It would definitely be a nice thing to have. I'll try implementing something like that for now. I'll keep an eye on the progress of this. Thanks!
Hi,
My Rails app has an api and html views. I make the difference using the json formats. Will it be possible to mix both authentication strategies somehow in the same controller? If the format is json return json, otherwise html, and always return the token, or otherwise return it only if the format is json. The other option would be to have a separate controller for api and html, but this doesn't sound so nice.
What do you think? Thanks!
The text was updated successfully, but these errors were encountered: