From 3478fe2b247c491006a827b131a5f52ff4a0dc44 Mon Sep 17 00:00:00 2001 From: Denis Natusch Date: Wed, 15 Nov 2023 01:24:35 +0100 Subject: [PATCH] Logout user when changing the username --- src/main/java/catering/users/UserController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/catering/users/UserController.java b/src/main/java/catering/users/UserController.java index 8fb1e56..7e52fb4 100644 --- a/src/main/java/catering/users/UserController.java +++ b/src/main/java/catering/users/UserController.java @@ -76,6 +76,10 @@ public class UserController { userManagement.save(user); + if (!username.isBlank()){ + return "redirect:/logout"; + } + return "redirect:/profile"; }