S
S
Sland Show2018-10-29 00:42:15
Java
Sland Show, 2018-10-29 00:42:15

How can I remove the log-in case when the user has already logged in?

How can I write tags in JSP so that the log in link disappears during authorization ?

I tried like this, but it didn't work:

<sec:authorize access="!hasRole('ROLE_ADMIN') || !hasRole('ROLE_MANAGER') || !hasRole('ROLE_USER') || getRole()">
            <a href="/login">Log in</a>
            </sec:authorize>

            <sec:authorize access="hasRole('ROLE_ADMIN') || hasRole('ROLE_MANAGER') || hasRole('ROLE_USER')">
                <a href="#">Log out</a>
            </sec:authorize>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2018-10-29
@SlandShow

<sec:authorize access="!isAuthenticated()">
    <a href="/login">Log in</a>
</sec:authorize>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question