Compare commits

..

No commits in common. "77ac771b8f99522ff792ce1ab82919bc1ca1f82b" and "25c5c1b018cdde9861e74068d6cb5e00b48f2c67" have entirely different histories.

3 changed files with 6 additions and 7 deletions

View File

@ -125,7 +125,7 @@ public class UserController {
@DeleteMapping("/user/{id}")
public ResponseEntity<String> deleteStudent(@RequestHeader("Authorization") String token, @PathVariable Long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token) || id.equals(authServ.getUserFromToken(token).getRegNo()))
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
User toDelete = userService.getUserById(id);

View File

@ -15,10 +15,11 @@ window.onhashchange = function() {
const Logged = ref(isLogged());
window.addEventListener('hashchange', () => {
if((location.hash === "#/home" && prevURL === "#/login") || (location.hash === "#/home" && prevURL === "#/profil")){
if((location.hash === "#/home" && prevURL === "#/login") || location.hash === "#/home" && prevURL === "#/profil" && !Logged)){
window.location.reload();
}
});
})
const home=ref(i18n("app.home"))
const notifications=ref(i18n("app.notifications"))
const settings=ref(i18n("app.settings"))

View File

@ -56,10 +56,8 @@
}
async function unRegister(){
disconnect();
setTimeout(() => {
window.location.href="#/home";
}, "500");
await deleteUser(user.regNo);
}