Compare commits
3 Commits
25c5c1b018
...
77ac771b8f
Author | SHA1 | Date | |
---|---|---|---|
77ac771b8f | |||
3762750968 | |||
a276c24f8f |
@ -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))
|
||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token) || id.equals(authServ.getUserFromToken(token).getRegNo()))
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
User toDelete = userService.getUserById(id);
|
||||
|
@ -15,11 +15,10 @@ window.onhashchange = function() {
|
||||
const Logged = ref(isLogged());
|
||||
|
||||
window.addEventListener('hashchange', () => {
|
||||
if((location.hash === "#/home" && prevURL === "#/login") || location.hash === "#/home" && prevURL === "#/profil" && !Logged)){
|
||||
if((location.hash === "#/home" && prevURL === "#/login") || (location.hash === "#/home" && prevURL === "#/profil")){
|
||||
window.location.reload();
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
const home=ref(i18n("app.home"))
|
||||
const notifications=ref(i18n("app.notifications"))
|
||||
const settings=ref(i18n("app.settings"))
|
||||
|
@ -56,8 +56,10 @@
|
||||
}
|
||||
|
||||
async function unRegister(){
|
||||
await deleteUser(user.regNo);
|
||||
|
||||
disconnect();
|
||||
setTimeout(() => {
|
||||
window.location.href="#/home";
|
||||
}, "500");
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user