-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Introduce SignOut method to ElympicsLobbyClient
- Loading branch information
Dawid Sygocki
committed
May 1, 2023
1 parent
3a29f97
commit ff3bdd0
Showing
16 changed files
with
181 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
|
||
namespace Elympics.Models.Authentication | ||
{ | ||
public class AuthData | ||
{ | ||
public Guid UserId { get; } | ||
public string JwtToken { get; } | ||
public AuthType AuthType { get; } | ||
|
||
internal string BearerAuthorization => $"Bearer {JwtToken}"; | ||
|
||
public AuthData(Guid userId, string jwtToken, AuthType authType = AuthType.None) | ||
{ | ||
UserId = userId; | ||
JwtToken = jwtToken; | ||
AuthType = authType; | ||
} | ||
|
||
public AuthData(AuthenticationDataResponse response, AuthType authType = AuthType.None) | ||
{ | ||
UserId = new Guid(response.userId); | ||
JwtToken = response.jwtToken; | ||
AuthType = authType; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
29 changes: 10 additions & 19 deletions
29
Runtime/Communication/Authentication/Models/AuthenticationData.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 |
---|---|---|
@@ -1,25 +1,16 @@ | ||
using System; | ||
using Elympics.Models.Authentication; | ||
|
||
namespace Elympics.Models.Authentication | ||
namespace Elympics | ||
{ | ||
// TODO: rename to shorter AuthData (but uhh backwards compatibility) ~dsygocki 2023-04-19 | ||
public class AuthenticationData | ||
// TODO: in the process of renaming to shorter AuthData (backwards compatibility) ~dsygocki 2023-04-28 | ||
public class AuthenticationData : AuthData | ||
{ | ||
public Guid UserId { get; } | ||
public string JwtToken { get; } | ||
|
||
internal string BearerAuthorization => $"Bearer {JwtToken}"; | ||
|
||
public AuthenticationData(Guid userId, string jwtToken) | ||
{ | ||
UserId = userId; | ||
JwtToken = jwtToken; | ||
} | ||
|
||
public AuthenticationData(AuthenticationDataResponse response) | ||
{ | ||
UserId = new Guid(response.userId); | ||
JwtToken = response.jwtToken; | ||
} | ||
public AuthenticationData(AuthData authData) | ||
: base(authData.UserId, authData.JwtToken, authData.AuthType) { } | ||
public AuthenticationData(Guid userId, string jwtToken, AuthType authType = AuthType.None) | ||
: base(userId, jwtToken, authType) { } | ||
public AuthenticationData(AuthenticationDataResponse response, AuthType authType = AuthType.None) | ||
: base(response, authType) { } | ||
} | ||
} |
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
Oops, something went wrong.