mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 18:18:39 +00:00
Implement checking for the Patchwork user agent, move logout into standalone method
This commit is contained in:
parent
df7ebf977a
commit
68dbf50253
7 changed files with 72 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
|||
using LBPUnion.ProjectLighthouse.Database;
|
||||
using LBPUnion.ProjectLighthouse.Extensions;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Servers.GameServer.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Token;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
@ -30,10 +30,7 @@ public class LogoutController : ControllerBase
|
|||
UserEntity? user = await this.database.UserFromGameToken(token);
|
||||
if (user == null) return this.Forbid();
|
||||
|
||||
user.LastLogout = TimeHelper.TimestampMillis;
|
||||
|
||||
await this.database.GameTokens.RemoveWhere(t => t.TokenId == token.TokenId);
|
||||
await this.database.LastContacts.RemoveWhere(c => c.UserId == token.UserId);
|
||||
await LogoutHelper.Logout(token, user, database);
|
||||
|
||||
return this.Ok();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue