Browse Source

Merge branch 'devel'

devel
Stephan Richter 5 days ago
parent
commit
7255e5b4b0
  1. 2
      de.srsoftware.oidc.backend/src/main/java/de/srsoftware/oidc/backend/ClientController.java
  2. 4
      de.srsoftware.oidc.web/src/main/resources/de/reset.html
  3. 5
      de.srsoftware.oidc.web/src/main/resources/en/reset.html
  4. 14
      de.srsoftware.oidc.web/src/main/resources/en/scripts/index.js
  5. 12
      de.srsoftware.oidc.web/src/main/resources/en/scripts/reset.js

2
de.srsoftware.oidc.backend/src/main/java/de/srsoftware/oidc/backend/ClientController.java

@ -169,7 +169,7 @@ public class ClientController extends Controller { @@ -169,7 +169,7 @@ public class ClientController extends Controller {
.stream()
.map(clients::getClient)
.flatMap(Optional::stream)
.sorted(Comparator.comparing(Client::name))
.sorted(Comparator.comparing(Client::name, String.CASE_INSENSITIVE_ORDER))
.map(Client::safeMap)
.toList();
return sendContent(ex, Map.of(AUTHORZED, authorizedClients, NAME, user.realName()));

4
de.srsoftware.oidc.web/src/main/resources/de/reset.html

@ -42,6 +42,10 @@ @@ -42,6 +42,10 @@
<th>Error</th>
<td class="warning">Zugriffs-Token gefunden, ist aber ungültig!</td>
</tr>
<tr id="other_error" style="display: none">
<th>Error</th>
<td class="warning" id="other_error_text">Unbekannter Fehler!</td>
</tr>
<tr>
<td></td>
<td><button id="passBtn" type="button" onClick="updatePass()">Aktualisieren</button></td>

5
de.srsoftware.oidc.web/src/main/resources/en/reset.html

@ -42,6 +42,11 @@ @@ -42,6 +42,11 @@
<th>Error</th>
<td class="warning">I received an access token, but it is invalid!</td>
</tr>
<tr id="other_error" style="display: none">
<th>Error</th>
<td class="warning" id="other_error_text">Unknown error!</td>
</tr>
<tr>
<td></td>
<td><button id="passBtn" type="button" onClick="updatePass()">Update</button></td>

14
de.srsoftware.oidc.web/src/main/resources/en/scripts/index.js

@ -11,12 +11,18 @@ function handleDash(response){ @@ -11,12 +11,18 @@ function handleDash(response){
var clients = data.authorized;
var content = document.getElementById('content');
var any = false;
var lastLetter = null;
for (let id in clients){
var client = clients[id];
if (client.landing_page){
var div = document.createElement("div");
div.innerHTML = `<button onclick="window.open('${client.landing_page}','_blank').focus();">${client.name}</button>`;
content.append(div);
if (client.landing_page){
var initialLetter = client.name.charAt(0).toUpperCase();
if (initialLetter != lastLetter) {
if (lastLetter) content.append(document.createElement("br"));
lastLetter = initialLetter;
}
var span = document.createElement("span");
span.innerHTML = `<button onclick="window.location.href='${client.landing_page}';">${client.name}</button>`;
content.append(span);
any = true;
}
}

12
de.srsoftware.oidc.web/src/main/resources/en/scripts/reset.js

@ -10,10 +10,14 @@ function handlePasswordResponse(response){ @@ -10,10 +10,14 @@ function handlePasswordResponse(response){
} else {
setText('passBtn', 'Update failed!');
response.text().then(text => {
if (text == 'invalid token') show('invalid_token');
if (text == 'token missing') show('missing_token');
if (text == 'password mismatch') show('password_mismatch');
if (text == 'weak password') show('weak_password');
if (text == 'invalid token') show('invalid_token'); else
if (text == 'token missing') show('missing_token'); else
if (text == 'password mismatch') show('password_mismatch'); else
if (text == 'weak password') show('weak_password'); else {
setText('other_error_text',text);
show('other_error');
}
});
}
enable('passBtn');

Loading…
Cancel
Save