implemented user logout
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
<title>Light OIDC</title>
|
||||
<script src="common.js"></script>
|
||||
<script src="login.js"></script>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Login</h1>
|
||||
@@ -15,7 +16,7 @@
|
||||
</label>
|
||||
<label>
|
||||
Password
|
||||
<input type="password" id="password" />
|
||||
<input type="password" id="password" onkeydown="keyDown()"/>
|
||||
</label>
|
||||
<button type="button" onClick="tryLogin()">Login</button>
|
||||
</fieldset>
|
||||
|
||||
@@ -30,4 +30,8 @@ function tryLogin(){
|
||||
})
|
||||
}).then(handleLogin);
|
||||
return false;
|
||||
}
|
||||
|
||||
function keyDown(ev){
|
||||
if (event.keyCode == 13) tryLogin();
|
||||
}
|
||||
12
de.srsoftware.oidc.web/src/main/resources/en/logout.html
Normal file
12
de.srsoftware.oidc.web/src/main/resources/en/logout.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Light OIDC</title>
|
||||
<script src="common.js"></script>
|
||||
<script src="logout.js"></script>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
You are being logged out…
|
||||
</body>
|
||||
</html>
|
||||
7
de.srsoftware.oidc.web/src/main/resources/en/logout.js
Normal file
7
de.srsoftware.oidc.web/src/main/resources/en/logout.js
Normal file
@@ -0,0 +1,7 @@
|
||||
function handleLogout(response){
|
||||
if (response.ok){
|
||||
document.body.innerHTML += 'success';
|
||||
document.location.href='index.html';
|
||||
}
|
||||
}
|
||||
fetch(api+"/logout").then(handleLogout)
|
||||
@@ -4,6 +4,7 @@
|
||||
<title>Light OIDC</title>
|
||||
<script src="common.js"></script>
|
||||
<script src="user.js"></script>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Add new client</h1>
|
||||
|
||||
@@ -38,15 +38,15 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th>Old password</th>
|
||||
<td><input id="oldpass1" type="password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Repeat Password</th>
|
||||
<td><input id="oldpass2" type="password"></td>
|
||||
<td><input id="oldpass" type="password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>New Password</th>
|
||||
<td><input id="newpass" type="password"></td>
|
||||
<td><input id="newpass1" type="password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Repeat Password</th>
|
||||
<td><input id="newpass2" type="password" onkeydown="passKeyDown()"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<button id="passBtn" type="button" onClick="updatePass()">Update</button>
|
||||
|
||||
@@ -47,8 +47,8 @@ function updatePass(){
|
||||
disable('passBtn');
|
||||
setText('passBtn','sent…');
|
||||
var newData = {
|
||||
oldpass : [getValue('oldpass1'),getValue('oldpass2')],
|
||||
newpass : getValue('newpass'),
|
||||
oldpass : getValue('oldpass'),
|
||||
newpass : [getValue('newpass1'),getValue('newpass2')],
|
||||
uuid : getValue('uuid')
|
||||
}
|
||||
fetch(api+'/update/password',{
|
||||
@@ -65,4 +65,8 @@ function updatePass(){
|
||||
},10000);
|
||||
}
|
||||
|
||||
function passKeyDown(ev){
|
||||
if (event.keyCode == 13) updatePass();
|
||||
}
|
||||
|
||||
setTimeout(fillForm,100);
|
||||
Reference in New Issue
Block a user