-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BaseController] Localize OPTIONS (optional auth)
This allows translating of OPTION data if a user is logged in. To achieve this, the commit does a few things: - Split up require_api_user_or_token to pull out the "authentication" step into it's own method: `.authenticate_user` - Create a new method called `.optional_api_user_or_token` for only OPTIONS requests - Logs in a user in on OPTIONS calls, but no-op if it fails - in otherwords: if you don't pass auth, still work as we did, but allow a user to log in and retrieve settings By doing this, we can make sure that `:set_gettext_locale` can have a user if one is provided, and allow translations to be processed further down the line.
- Loading branch information
1 parent
ee146eb
commit 39e340e
Showing
3 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters