<p></p>
<p><b>@gravitystorm</b> requested changes on this pull request.</p>
<p dir="auto">Other than the inline comments, looks good to me.</p><hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4500#discussion_r1472897299">app/controllers/oauth_clients_controller.rb</a>:</p>
<pre style='color:#555'>> @@ -19,7 +19,11 @@ def show
end
def new
- @client_application = ClientApplication.new
+ if Settings.oauth_10_registration
+ @client_application = ClientApplication.new
+ else
+ redirect_to :action => "index"
</pre>
<p dir="auto">I think this needs a flash message. If we're doing more than just removing the link from the index page, then I guess we're trying to handle external links to <code class="notranslate">:new</code> e.g. from a tutorial somewhere. A flash message would explain why the link to <code class="notranslate">:new</code> no longer works.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4500#discussion_r1472900886">config/settings.yml</a>:</p>
<pre style='color:#555'>> @@ -97,6 +97,7 @@ attachments_dir: ":rails_root/public/attachments"
basic_auth_support: true
# Enable legacy OAuth 1.0 support
oauth_10_support: true
+oauth_10_registration: true
</pre>
<p dir="auto">I think just a simple test for the <code class="notranslate">:new -> :index</code> redirect would be needed and is also worthwhile.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4500#discussion_r1472899729">app/controllers/oauth_clients_controller.rb</a>:</p>
<pre style='color:#555'>> @@ -19,7 +19,11 @@ def show
end
def new
- @client_application = ClientApplication.new
+ if Settings.oauth_10_registration
+ @client_application = ClientApplication.new
+ else
+ redirect_to :action => "index"
</pre>
<p dir="auto">Does <code class="notranslate">:create</code> need a similar redirect? Or are we happy that if the form is removed, then anyone going to the lengths of making a direct <code class="notranslate">:post</code> with the correct CSRF token is only causing problems for themselves?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4500#pullrequestreview-1853862362">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLL5PKUXBKGDPL2OXZTYRJH4PAVCNFSM6AAAAABCONBIB2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNJTHA3DEMZWGI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLIA3LHV7PAOLKRLJ2TYRJH4PA5CNFSM6AAAAABCONBIB2WGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTTOP6Y5U.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4500/review/1853862362</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4500#pullrequestreview-1853862362",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4500#pullrequestreview-1853862362",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>