-
-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
10 changed files
with
81 additions
and
12 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
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
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
40 changes: 40 additions & 0 deletions
40
...emplates/Boilerplate/Bit.Boilerplate/src/Shared/Exceptions/ReusedRefreshTokenException.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,40 @@ | ||
using System.Net; | ||
|
||
namespace Boilerplate.Shared.Exceptions; | ||
|
||
/// <summary> | ||
/// Represents an exception that is thrown when a refresh token has been reused and is no longer valid. | ||
/// </summary> | ||
/// <remarks> | ||
/// Refresh token rotation ensures that each refresh token can only be used once. | ||
/// This exception is typically thrown to indicate a potential security issue or misuse of the refresh token. | ||
/// </remarks> | ||
public class ReusedRefreshTokenException : RestException | ||
{ | ||
public ReusedRefreshTokenException() | ||
: base(nameof(AppStrings.ConcurrentUserSessionOnTheSameDevice)) | ||
{ | ||
} | ||
|
||
public ReusedRefreshTokenException(string message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
public ReusedRefreshTokenException(string message, Exception? innerException) | ||
: base(message, innerException) | ||
{ | ||
} | ||
|
||
public ReusedRefreshTokenException(LocalizedString message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
public ReusedRefreshTokenException(LocalizedString message, Exception? innerException) | ||
: base(message, innerException) | ||
{ | ||
} | ||
|
||
public override HttpStatusCode StatusCode => HttpStatusCode.Unauthorized; | ||
} |
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