-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from theImmortalCoders/issue-39
Issue 39
- Loading branch information
Showing
23 changed files
with
517 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,5 @@ public enum Role | |
{ | ||
Student, | ||
Teacher, | ||
Special, | ||
Admin | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#region | ||
|
||
using rag_2_backend.Infrastructure.Database; | ||
using rag_2_backend.Infrastructure.Database.Entity; | ||
|
||
#endregion | ||
|
||
namespace rag_2_backend.Infrastructure.Dao; | ||
|
||
public class RefreshTokenDao(DatabaseContext context) | ||
{ | ||
public void RemoveTokensForUser(User user) | ||
{ | ||
var unusedTokens = context.RefreshTokens.Where(r => r.User.Id == user.Id).ToList(); | ||
context.RefreshTokens.RemoveRange(unusedTokens); | ||
context.SaveChanges(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
rag-2-backend/Infrastructure/Database/Entity/BlacklistedJwt.cs
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
rag-2-backend/Infrastructure/Database/Entity/RefreshToken.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#region | ||
|
||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
#endregion | ||
|
||
namespace rag_2_backend.Infrastructure.Database.Entity; | ||
|
||
[Table("refresh_token_table")] | ||
public class RefreshToken | ||
{ | ||
[Key] [MaxLength(100)] public required string Token { get; init; } | ||
public required DateTime Expiration { get; set; } | ||
public required User User { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
rag-2-backend/Infrastructure/Module/Administration/Dto/LimitsResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace rag_2_backend.Infrastructure.Module.Administration.Dto; | ||
|
||
public class LimitsResponse | ||
{ | ||
public required int StudentLimitMb { get; set; } | ||
public required int TeacherLimitMb { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
rag-2-backend/Infrastructure/Module/User/Dto/UserLoginResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace rag_2_backend.Infrastructure.Module.User.Dto; | ||
|
||
public class UserLoginResponse | ||
{ | ||
public required string JwtToken { get; set; } | ||
public required string RefreshToken { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.