Base solution for your next web application
Open Closed

[user] IsAuthenticated via angularJS/SPA #553


User avatar
0
daws created

Hi !

Is there any way to get the information if a user is logged in, in javascript without using "abp.services.app.session.getCurrentLoginInformations" ?

I would like to get the same top/right user section from Dashboard, on another SPA which could be accessible for public & authenticated user.

if not logged in, i'll include "login" link. if logged in, i'll display the menu.

in aspnetzero, this module in home page is from a mvc view with @model; i try to avoid the model, since my home controller return directly an angular page and not an mvc view, so i can't have the model with infos.

thks !


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    Yes, you can use abp.session.userId to check if current user is logged in. If so, abp.session.userId will be his Id. If not, abp.session.userId will be null.