Compare commits
No commits in common. "77ac771b8f99522ff792ce1ab82919bc1ca1f82b" and "25c5c1b018cdde9861e74068d6cb5e00b48f2c67" have entirely different histories.
77ac771b8f
...
25c5c1b018
@ -125,7 +125,7 @@ public class UserController {
|
|||||||
|
|
||||||
@DeleteMapping("/user/{id}")
|
@DeleteMapping("/user/{id}")
|
||||||
public ResponseEntity<String> deleteStudent(@RequestHeader("Authorization") String token, @PathVariable Long 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);
|
return new UnauthorizedResponse<>(null);
|
||||||
|
|
||||||
User toDelete = userService.getUserById(id);
|
User toDelete = userService.getUserById(id);
|
||||||
|
@ -15,10 +15,11 @@ window.onhashchange = function() {
|
|||||||
const Logged = ref(isLogged());
|
const Logged = ref(isLogged());
|
||||||
|
|
||||||
window.addEventListener('hashchange', () => {
|
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();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
const home=ref(i18n("app.home"))
|
const home=ref(i18n("app.home"))
|
||||||
const notifications=ref(i18n("app.notifications"))
|
const notifications=ref(i18n("app.notifications"))
|
||||||
const settings=ref(i18n("app.settings"))
|
const settings=ref(i18n("app.settings"))
|
||||||
|
@ -56,10 +56,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function unRegister(){
|
async function unRegister(){
|
||||||
disconnect();
|
await deleteUser(user.regNo);
|
||||||
setTimeout(() => {
|
|
||||||
window.location.href="#/home";
|
|
||||||
}, "500");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user