Open Closed

How To use Abp Account/Login Source Code #7573


User avatar
0
WilliamT created
  • ABP Framework version: v8.2.0
  • UI Type: MVC
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi I want to add extra verification code input field on my login. I tried to modify the page and model using this https://github.com/abpframework/abp/blob/dev/source-code/Volo.Abp.Account.SourceCode/Volo.Abp.Account.SourceCode.zip

however i got error "ThereAreNoLoginSchemesConfiguredForThisClient"

how do i actually use this source code?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

7 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    I tried to modify the page and model using this https://github.com/abpframework/abp/blob/dev/source-code/Volo.Abp.Account.SourceCode/Volo.Abp.Account.SourceCode.zip

    This is open source,

    you can use suite to download the commercial module source Code

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    WilliamT created

    yep, got it working now.

    and how do I make the app redirect to login if the user isn't logged in?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    you can try

    public class IndexModel : ...
    {
        public ActionResult OnGet()
        {
            if (!CurrentUser.IsAuthenticated)
            {
                return Redirect("/Account/Login");
            }
    
            return Page();
        }
    }
    
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    WilliamT created

    Do I need to apply that to all pages?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    yes,

    another simple way is

    @attribute [Authorize]
    ..
    
    page code...
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    WilliamT created

    thanks,

    seems like adding the code only to Index.cshtml.cs under Pages folder seem to be applied for all subfolder as well.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    :)

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.