Added login redirection, level icon background and fixed bugs (#371)

This commit is contained in:
Josh 2022-07-25 16:53:43 -05:00 committed by GitHub
commit 3c8f195740
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 8 deletions

View file

@ -22,7 +22,7 @@ public class LoginForm : BaseLayout
public string? Error { get; private set; }
[UsedImplicitly]
public async Task<IActionResult> OnPost(string username, string password)
public async Task<IActionResult> OnPost(string username, string password, string redirect)
{
if (string.IsNullOrWhiteSpace(username))
{
@ -105,7 +105,11 @@ public class LoginForm : BaseLayout
if (user.PasswordResetRequired) return this.Redirect("~/passwordResetRequired");
if (ServerConfiguration.Instance.Mail.MailEnabled && !user.EmailAddressVerified) return this.Redirect("~/login/sendVerificationEmail");
return this.RedirectToPage(nameof(LandingPage));
if (string.IsNullOrWhiteSpace(redirect))
{
return this.RedirectToPage(nameof(LandingPage));
}
return this.Redirect(redirect);
}
[UsedImplicitly]