Base solution for your next web application
Open Closed

Use application with and without login #1004


User avatar
0
frei created

Hi

I'm new in Abp. I use module-zero. It's very cool!!

The user Login is work perfectly, but I would like to use it without login or login at the end ofthe workflow.

So, I put a "Without login" button on the login page.

It call WithoutLogin method in AccountManager class.

public ActionResult WithoutLogin() {
return View("~/App/Main/views/layout/layout.cshtml"); //return Redirect(Url.Action("Index", "Home")); }

But the application response 'No user logged in!'


4 Answer(s)
  • User Avatar
    0
    frei created

    And the questions :) Is it possible :?: :?: And how :?:

  • User Avatar
    0
    hikalkan created
    Support Team

    Remove [AbpMvcAuthorize] attribute from HomeController (<a class="postlink" href="https://github.com/aspnetboilerplate/module-zero-template/blob/master/src/AbpCompanyName.AbpProjectName.WebSpaAngular/Controllers/HomeController.cs#L6">https://github.com/aspnetboilerplate/mo ... ller.cs#L6</a>).

  • User Avatar
    0
    frei created

    Thank you for your the reply.

    I tried it, but it didn't help.

    I modified

    SessionAppService.cs GetCurrentLoginInformations() and ...AppServiceBase.cs GetCurrentUserAsync()

    It throws exception because AbpSession.GetUserId() is null.

  • User Avatar
    0
    hikalkan created
    Support Team

    Sure, you should also remove that code and it's usage since there is no session information if user is not logged in.