+logout working

This commit is contained in:
Julian Hinxlage 2019-06-05 13:22:52 +02:00
parent d1a45681a2
commit a53cccc52e
2 changed files with 8 additions and 2 deletions

View File

@ -33,7 +33,6 @@ public class UserBean {
@Getter @Getter
private boolean error = false; private boolean error = false;
public String login() { public String login() {
Database db = Database.getInstance(); Database db = Database.getInstance();
User user = db.user().get(username); User user = db.user().get(username);
@ -56,6 +55,7 @@ public class UserBean {
public String logout() { public String logout() {
user = null; user = null;
loggedIn = false;
return "index.html"; return "index.html";
} }

View File

@ -47,7 +47,13 @@
<ol> <ol>
<li><a href="orders.xhtml">Meine Bestellungen</a></li> <li><a href="orders.xhtml">Meine Bestellungen</a></li>
<li><a href="">Adressen und Konten</a></li> <li><a href="">Adressen und Konten</a></li>
<li><a href="logout.xhtml">Abmelden</a></li> <h:form>
<h:commandLink action="#{userBean.logout}">Abmelden</h:commandLink>
<ui:remove>
<li><a href="logout.xhtml">Abmelden</a></li>
</ui:remove>
</h:form>
</ol> </ol>
</li> </li>
</ol> </ol>