working on client service
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
28
de.srsoftware.oidc.web/src/main/resources/en/clients.html
Normal file
28
de.srsoftware.oidc.web/src/main/resources/en/clients.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Light OIDC</title>
|
||||
<script src="config.js"></script>
|
||||
<script src="user.js"></script>
|
||||
<script src="clients.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<a id="clients" href="clients.html">Clients</a>
|
||||
</nav>
|
||||
<h1>Welcome!</h1>
|
||||
<h2>Clients</h2>
|
||||
These are clients that are registered with LightOIDC:
|
||||
<table>
|
||||
<tr>
|
||||
<th>Client</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button onclick="window.location.href='newclient.html';">Add new site…</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
11
de.srsoftware.oidc.web/src/main/resources/en/clients.js
Normal file
11
de.srsoftware.oidc.web/src/main/resources/en/clients.js
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
async function handleClients(response){
|
||||
if (response.status == UNAUTHORIZED) {
|
||||
window.location.href = 'login.html?return_to='+encodeURI(window.location.href);
|
||||
return;
|
||||
}
|
||||
var clients = await response.json();
|
||||
console.log(clients);
|
||||
}
|
||||
|
||||
fetch(api+"/clients",{method:'POST'}).then(handleClients);
|
||||
@@ -1,2 +1,4 @@
|
||||
var api = "/api";
|
||||
var web = "/web";
|
||||
var web = "/web";
|
||||
|
||||
const UNAUTHORIZED = 401;
|
||||
|
||||
@@ -6,19 +6,9 @@
|
||||
<script src="user.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<a id="clients" href="clients.html">Clients</a>
|
||||
</nav>
|
||||
<h1>Welcome!</h1>
|
||||
<h2>Clients</h2>
|
||||
These are clients that are registered with LightOIDC:
|
||||
<table>
|
||||
<tr>
|
||||
<th>Client</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button onclick="window.location.href='newclient.html';">Add new site…</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,4 +1,3 @@
|
||||
const UNAUTHORIZED = 401;
|
||||
|
||||
async function handleUser(response){
|
||||
if (response.status == UNAUTHORIZED) {
|
||||
|
||||
Reference in New Issue
Block a user