mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-09-22 17:29:10 +00:00
parent
86bcd9b3a5
commit
b165d5a2ce
1 changed files with 11 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
#nullable enable
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using Kettu;
|
||||
|
@ -7,6 +8,7 @@ using LBPUnion.ProjectLighthouse.Helpers.Extensions;
|
|||
using LBPUnion.ProjectLighthouse.Logging;
|
||||
using LBPUnion.ProjectLighthouse.Pages.Layouts;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
@ -71,7 +73,15 @@ public class LoginForm : BaseLayout
|
|||
this.Database.WebTokens.Add(webToken);
|
||||
await this.Database.SaveChangesAsync();
|
||||
|
||||
this.Response.Cookies.Append("LighthouseToken", webToken.UserToken);
|
||||
this.Response.Cookies.Append
|
||||
(
|
||||
"LighthouseToken",
|
||||
webToken.UserToken,
|
||||
new CookieOptions
|
||||
{
|
||||
Expires = DateTimeOffset.Now.AddDays(7),
|
||||
}
|
||||
);
|
||||
|
||||
Logger.Log($"User {user.Username} (id: {user.UserId}) successfully logged in on web", LoggerLevelLogin.Instance);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue