-
Notifications
You must be signed in to change notification settings - Fork 57
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
Allow anonymous profile view #1304
base: hometown-dev
Are you sure you want to change the base?
Allow anonymous profile view #1304
Commits on Apr 10, 2023
-
Exempt Emoji API endpoint from auth
When viewing a profile anonymously, the request for custom emoji will show a 401 Unauthorized error to the user. Exempt this endpoint from the authentication requirement.
Configuration menu - View commit details
-
Copy full SHA for 1c4948d - Browse repository at this point
Copy the full SHA 1c4948dView commit details -
Move unless criteria into boolean method
It's helpful to be able to ask the parent class whether we would disallow API access based on the current request (and hence whether we know the requesting user) rather than simply based on configuration. This doesn't appear to regress any existing functionality.
Configuration menu - View commit details
-
Copy full SHA for 9fbcfe7 - Browse repository at this point
Copy the full SHA 9fbcfe7View commit details -
Add user-oriented helper methods
This centralizes the core check for the user's preferences into a single helper method, and gives us one place to change the user preference flag if it turns out user_prefers_noindex isn't appropriate. Also adds a convenience error response specific to the user visibility situation.
Configuration menu - View commit details
-
Copy full SHA for 0c9c7b8 - Browse repository at this point
Copy the full SHA 0c9c7b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 135b9f5 - Browse repository at this point
Copy the full SHA 135b9f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86ba692 - Browse repository at this point
Copy the full SHA 86ba692View commit details -
Configuration menu - View commit details
-
Copy full SHA for 744f500 - Browse repository at this point
Copy the full SHA 744f500View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d7e61d - Browse repository at this point
Copy the full SHA 7d7e61dView commit details
Commits on May 7, 2023
-
Review fix: Use only directive for all auth skips
IanWhitney's review pointed out that it is more consistent and a safer default to include the "only:" directive for all cases where we skip the user authentication requirement. In particular: if a future public method is added to this controller, it should not be implicitly available pre-auth.
Configuration menu - View commit details
-
Copy full SHA for e6f8a67 - Browse repository at this point
Copy the full SHA e6f8a67View commit details -
Review fix: Avoid ternary expressions
It seems I let my inner C programmer get the better of me. Per IanWhitney's review, Ruby's if structures are expressions and return values, which make them more suitable than a ternary expression in terms of readability.
Configuration menu - View commit details
-
Copy full SHA for 3897eaa - Browse repository at this point
Copy the full SHA 3897eaaView commit details -
Review fix: Restructure for early return
Per IanWhitney's review, the complex logic with the unless clause is pretty clumsy. We can check this condition first and return false immediately, and leave the remaining logic as a simpler statement on its own.
Configuration menu - View commit details
-
Copy full SHA for 641b071 - Browse repository at this point
Copy the full SHA 641b071View commit details