improving path handling, working on authorization flow
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
12
de.srsoftware.oidc.web/src/main/resources/en/user.js
Normal file
12
de.srsoftware.oidc.web/src/main/resources/en/user.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const UNAUTHORIZED = 401;
|
||||
|
||||
async function handleUser(response){
|
||||
if (response.status == UNAUTHORIZED) {
|
||||
window.location.href = 'login.html?return_to='+encodeURI(window.location.href);
|
||||
return;
|
||||
}
|
||||
var user = await response.json();
|
||||
// TODO: load navigation
|
||||
}
|
||||
|
||||
fetch(api+"/user",{method:'POST'}).then(handleUser);
|
||||
Reference in New Issue
Block a user