I trying add authentication to .net Core 2.1 application. Starting from scratch: We can create new web application with react using VS template.
In this tempate we can see:
app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";
spa.ApplicationBuilder.UseAuthentication();
if (env.IsDevelopment())
{
spa.UseReactDevelopmentServer(npmScript: "start");
}
});
I also added Auth controller and views with login/register endpoints.
How can I add logic which will reject access to SPA untill we will login to application?
I know how to use asp.net identity regullary but with this SPA I need advice.