Is it possible to Redirect to login page after status code 400 in aspnetboilerplate?

Viewed 64

It is AuthenticationProperties config:

 AuthenticationManager.SignIn(new AuthenticationProperties
        {
            IsPersistent = false,
            AllowRefresh = true,
            ExpiresUtc = DateTimeOffset.UtcNow.AddHours(int.Parse("2"))
        }, identity);

after 2 hour user get error

400 (Empty or invalid anti forgery header token.)

how can I automatically redirect user to login page after getting this error? Aspnetboilerplate SPA+MVC+Angularjs version 5.10.1

1 Answers

You can disable checking anti-forgery validation by using the following code in you PreInitialize()

Configuration.Modules.AbpWeb().AntiForgery.IsEnabled = false;

Does this fix your issue or you need to check anti-forgery validation?

Related