0

I'm new in VueJS and have a problem: I can authenticate a user with adldap2 in php. But how can I check in VueJS whether the user is authenticated? The login expires after 2 hours and the user should not be able to interact with the website when not longer logged in. By the way, I also need "Auth::user()" in backend.

So I try to find a way to get something like let user = Auth.user; in VueJS and Auth::user(); in PHP.

I need it in VueJS for things like that:

<div class="row" v-if="Auth.checked">
    <div class="col-md-12">
        <!-- "navigation" is a custom component in VueJS -->
        <navigation :items="menuItems" v-on:ask-upgrade="showUpgrade = true"></navigation>
    </div>
</div>

1 Answer 1

0

I get a solution. Here is the tutorial what I used for my problem. My auth.js file is very larger now but I need a lot of auth stuff for routing.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.