This commit is contained in:
@@ -14,23 +14,14 @@ namespace Auth.Controllers {
|
|||||||
_databaseService = databaseService;
|
_databaseService = databaseService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SignIn(HttpResponse Response, bool StayLoggedIn, string jwt) {
|
public static void SignIn(HttpResponse Response, string jwt) {
|
||||||
if (StayLoggedIn) {
|
// Stay logged in cookie
|
||||||
// Stay logged in cookie
|
Response.Cookies.Append(AuthJWT.TokenName, jwt, new CookieOptions {
|
||||||
Response.Cookies.Append(AuthJWT.TokenName, jwt, new CookieOptions {
|
Secure = true,
|
||||||
Secure = true,
|
HttpOnly = true,
|
||||||
HttpOnly = true,
|
SameSite = SameSiteMode.Strict,
|
||||||
SameSite = SameSiteMode.Strict,
|
Expires = DateTime.UtcNow.AddDays(7)
|
||||||
Expires = DateTime.UtcNow.AddDays(7)
|
});
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// Session cookie
|
|
||||||
Response.Cookies.Append(AuthJWT.TokenName, jwt, new CookieOptions {
|
|
||||||
Secure = true,
|
|
||||||
HttpOnly = true,
|
|
||||||
SameSite = SameSiteMode.Strict,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SignOut(HttpResponse Response) {
|
public static void SignOut(HttpResponse Response) {
|
||||||
|
|||||||
Reference in New Issue
Block a user