|
12 | 12 | <% } %> |
13 | 13 | </div> |
14 | 14 | <% if (!notAuthorized) { %> |
15 | | - <% if (strict_auth_mechanism !== undefined && strict_auth_mechanism.type === "oauth2") { %> |
| 15 | + <% if (strict_auth_mechanism != null && strict_auth_mechanism.type === "oauth2") { %> |
16 | 16 | <button id="login" onclick="oauth_initiateLogin('<%=strict_auth_mechanism.resource_id%>')">Click here to log in</button> |
17 | 17 | <% } else if ((typeof resource_servers == 'object' && resource_servers.length == 1) && oauth_disable_basic_auth) { %> |
18 | 18 | <button id="login" onclick="oauth_initiateLogin('<%=resource_servers[0].id%>')">Click here to log in</button> |
19 | | - <% } else if (typeof resource_servers == 'object' && resource_servers.length >= 1 && strict_auth_mechanism == undefined) { %> |
| 19 | + <% } else if (typeof resource_servers == 'object' && resource_servers.length >= 1 && strict_auth_mechanism == null) { %> |
20 | 20 |
|
21 | 21 | <b>Login with :</b> |
22 | 22 | <p/> |
23 | | - <% const OAuth2Visible = (strict_auth_mechanism === undefined || strict_auth_mechanism.type === "oauth2") || |
24 | | - (preferred_auth_mechanism === undefined || preferred_auth_mechanism === "oauth2"); %> |
25 | | - <% const OAuth2Invisible = (preferred_auth_mechanism !== undefined && preferred_auth_mechanism.type !== "oauth2"); %> |
26 | | - <% const OAuth2Hidden = (strict_auth_mechanism !== undefined && strict_auth_mechanism.type !== "oauth2"); %> |
27 | | - <% const preferredResourceId = preferred_auth_mechanism !== undefined && preferred_auth_mechanism.type === "oauth2" ? preferred_auth_mechanism.resource_id : null; %> |
| 23 | + <% const OAuth2Visible = (strict_auth_mechanism == null || strict_auth_mechanism.type === "oauth2") || |
| 24 | + (preferred_auth_mechanism == null || preferred_auth_mechanism === "oauth2"); %> |
| 25 | + <% const OAuth2Invisible = (preferred_auth_mechanism != null && preferred_auth_mechanism.type !== "oauth2"); %> |
| 26 | + <% const OAuth2Hidden = (strict_auth_mechanism != null && strict_auth_mechanism.type !== "oauth2"); %> |
| 27 | + <% const preferredResourceId = preferred_auth_mechanism != null && preferred_auth_mechanism.type === "oauth2" ? preferred_auth_mechanism.resource_id : null; %> |
28 | 28 | <!-- begin login with oauth2 --> |
29 | 29 | <% if (!OAuth2Hidden) { %> |
30 | 30 | <div class="section disable-pref <%= OAuth2Visible ? 'section-visible' : '' %> <%= OAuth2Invisible ? 'section-invisible' : '' %> " id="login-with-oauth2"> |
|
55 | 55 | <% } %> |
56 | 56 |
|
57 | 57 | <!-- begin login with basic auth --> |
58 | | - <% const basicAuthVisible = (strict_auth_mechanism !== undefined && strict_auth_mechanism.type === "basic") || |
59 | | - (preferred_auth_mechanism !== undefined && preferred_auth_mechanism.type === "basic"); %> |
60 | | - <% const basicAuthInvisible = (strict_auth_mechanism === undefined && preferred_auth_mechanism === undefined || (preferred_auth_mechanism !== undefined && preferred_auth_mechanism.type !== "basic"));%> |
61 | | - <% const basicAuthHidden = (strict_auth_mechanism !== undefined && strict_auth_mechanism.type !== "basic"); %> |
| 58 | + <% const basicAuthVisible = (strict_auth_mechanism != null && strict_auth_mechanism.type === "basic") || |
| 59 | + (preferred_auth_mechanism != null && preferred_auth_mechanism.type === "basic"); %> |
| 60 | + <% const basicAuthInvisible = (strict_auth_mechanism == null && preferred_auth_mechanism == null || (preferred_auth_mechanism != null && preferred_auth_mechanism.type !== "basic"));%> |
| 61 | + <% const basicAuthHidden = (strict_auth_mechanism != null && strict_auth_mechanism.type !== "basic"); %> |
62 | 62 | <% if (!oauth_disable_basic_auth && !basicAuthHidden) { %> |
63 | 63 | <div class="section disable-pref <%= basicAuthInvisible ? 'section-invisible' : ''%> <%= basicAuthVisible ? 'section-visible' : ''%> " id="login-with-basic-auth"> |
64 | 64 | <h2>Basic Authentication</h2> |
|
0 commit comments