From ca49527eb3bfdb4ad678c5924c44f830b10d4b19 Mon Sep 17 00:00:00 2001 From: rono23 Date: Wed, 6 Jan 2021 11:40:04 +0900 Subject: [PATCH] Check if `redirect_uri` exists --- CHANGELOG.md | 1 + .../doorkeeper/applications/show.html.erb | 28 +++++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a190b286a..63c9a3f68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ User-visible changes worth mentioning. ## master - [#PR ID] Add your PR description here. +- [#1469] Check if `redirect_uri` exists. - [#1465] Memoize nil doorkeeper_token - [#1457] Make owner_id a bigint for newly-generated owner migrations - [#1452] Empty previous_refresh_token only if present diff --git a/app/views/doorkeeper/applications/show.html.erb b/app/views/doorkeeper/applications/show.html.erb index 0bcebfe67..540ba4848 100644 --- a/app/views/doorkeeper/applications/show.html.erb +++ b/app/views/doorkeeper/applications/show.html.erb @@ -35,18 +35,22 @@

<%= t('.callback_urls') %>:

- - <% @application.redirect_uri.split.each do |uri| %> - - - - - <% end %> -
- <%= uri %> - - <%= link_to t('doorkeeper.applications.buttons.authorize'), oauth_authorization_path(client_id: @application.uid, redirect_uri: uri, response_type: 'code', scope: @application.scopes), class: 'btn btn-success', target: '_blank' %> -
+ <% if @application.redirect_uri.present? %> + + <% @application.redirect_uri.split.each do |uri| %> + + + + + <% end %> +
+ <%= uri %> + + <%= link_to t('doorkeeper.applications.buttons.authorize'), oauth_authorization_path(client_id: @application.uid, redirect_uri: uri, response_type: 'code', scope: @application.scopes), class: 'btn btn-success', target: '_blank' %> +
+ <% else %> + <%= t('.not_defined') %> + <% end %>