Skip to content

Commit e4e0ece

Browse files
Fix issue looking up logout button
1 parent 57358ac commit e4e0ece

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

deps/rabbitmq_management/priv/www/js/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ function startWithOAuthLogin () {
108108
function render_login_oauth(messages) {
109109
let formatData = {}
110110
formatData.warnings = []
111+
formatData.notAuthorized = false
111112
formatData.resource_servers = oauth.resource_servers
112113
formatData.declared_resource_servers_count = oauth.declared_resource_servers_count
113114
formatData.oauth_disable_basic_auth = oauth.oauth_disable_basic_auth
@@ -117,6 +118,7 @@ function render_login_oauth(messages) {
117118
} else if (typeof messages == "string") {
118119
formatData.warnings = [messages]
119120
formatData.notAuthorized = messages == "Not authorized"
121+
console.log("Single error message")
120122
}
121123
replace_content('outer', format('login_oauth', formatData))
122124

deps/rabbitmq_management/priv/www/js/tmpl/login_oauth.ejs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
<p class="warning"><%=warnings[i]%> </p>
88
<% } %>
99
<% } %>
10-
<% if (typeof notAuthorized == 'object' && notAuthorized) { %>
10+
<% if (notAuthorized) { %>
1111
<button id="logout" onclick="oauth_initiateLogout()">Click here to logout</button>
1212
<% } %>
1313
</div>
14-
<% if ((typeof resource_servers == 'object' && resource_servers.length == 1) && oauth_disable_basic_auth) { %>
15-
<button id="login" onclick="oauth_initiateLogin('<%=resource_servers[0].id%>')">Click here to log in</button>
16-
<% } else if (typeof resource_servers == 'object' && resource_servers.length >= 1) { %>
14+
<% if (!notAuthorized) { %>
15+
<% if ((typeof resource_servers == 'object' && resource_servers.length == 1) && oauth_disable_basic_auth) { %>
16+
<button id="login" onclick="oauth_initiateLogin('<%=resource_servers[0].id%>')">Click here to log in</button>
17+
<% } else if (typeof resource_servers == 'object' && resource_servers.length >= 1) { %>
1718
1819
<b>Login with :</b>
1920
<p/>
@@ -43,6 +44,7 @@
4344
</div>
4445
<!-- end login with oauth2 -->
4546
<% } %>
47+
4648
<!-- begin login with basic auth -->
4749
<% if (!oauth_disable_basic_auth) { %>
4850
<div class="section-hidden" id="login-with-basic-auth">
@@ -70,5 +72,6 @@
7072
</div>
7173
<% } %>
7274
<!-- end login with basic auth -->
75+
<% } %>
7376

7477
</div> <!-- login -->

0 commit comments

Comments
 (0)