diff options
author | lain <lain@soykaf.club> | 2020-08-06 16:54:32 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-08-06 16:54:32 +0000 |
commit | b9ebb55d2aabdf4c99b05efab9d4ad31b25f888d (patch) | |
tree | 06f4633e90ae43a772fd2b5bc4998a91c139ad8c /lib/pleroma | |
parent | 10b0e55acffeeff5842421c12b3b26feb35336de (diff) | |
parent | 135ae4e35a3e6a084eb611ce3a21c7a6c6bba9fc (diff) | |
download | pleroma-b9ebb55d2aabdf4c99b05efab9d4ad31b25f888d.tar.gz |
Merge branch '2025-oauth-login-default-to-all-scopes' into 'develop'
[#2025] Defaulted OAuth login scopes choice to all scopes when user selects no scopes
Closes #2025
See merge request pleroma/pleroma!2855
Diffstat (limited to 'lib/pleroma')
-rw-r--r-- | lib/pleroma/web/oauth/oauth_controller.ex | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex index f29b3cb57..dd00600ea 100644 --- a/lib/pleroma/web/oauth/oauth_controller.ex +++ b/lib/pleroma/web/oauth/oauth_controller.ex @@ -76,6 +76,13 @@ defmodule Pleroma.Web.OAuth.OAuthController do available_scopes = (app && app.scopes) || [] scopes = Scopes.fetch_scopes(params, available_scopes) + scopes = + if scopes == [] do + available_scopes + else + scopes + end + # Note: `params` might differ from `conn.params`; use `@params` not `@conn.params` in template render(conn, Authenticator.auth_template(), %{ response_type: params["response_type"], |