Open Closed

[user] IsAuthenticated via angularJS/SPA #553

daws created

Hi !

Is there any way to get the information if a user is logged in, in javascript without using "" ?

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)
  • 0
    hikalkan created
    Support Team


    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.