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

View File

@ -47,7 +47,13 @@
<ol>
<li><a href="orders.xhtml">Meine Bestellungen</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>
</li>
</ol>