-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathIAuthenticationService.cs
More file actions
57 lines (49 loc) · 1.73 KB
/
Copy pathIAuthenticationService.cs
File metadata and controls
57 lines (49 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System.Collections;
namespace GLMod.Services.Interfaces
{
/// <summary>
/// Interface for authentication and user session management
/// </summary>
public interface IAuthenticationService
{
/// <summary>
/// Gets the authentication token
/// </summary>
string Token { get; }
/// <summary>
/// Gets whether the user is currently logged in
/// </summary>
bool IsLoggedIn { get; }
/// <summary>
/// Gets whether the user is banned
/// </summary>
bool IsBanned { get; }
/// <summary>
/// Gets the ban reason if user is banned
/// </summary>
string BanReason { get; }
/// <summary>
/// Attempts to log in the user with Steam credentials
/// </summary>
/// <param name="onComplete">Callback with success status</param>
/// <returns>Coroutine</returns>
IEnumerator Login(System.Action<bool> onComplete = null);
/// <summary>
/// Logs out the current user
/// </summary>
void Logout();
/// <summary>
/// Gets the account name from the authentication token
/// </summary>
/// <returns>Account name or empty string if not logged in</returns>
string GetAccountName();
/// <summary>
/// Updates the login state
/// </summary>
/// <param name="isLoggedIn">Whether user is logged in</param>
/// <param name="token">Authentication token</param>
/// <param name="isBanned">Whether user is banned</param>
/// <param name="banReason">Ban reason</param>
void SetLoginState(bool isLoggedIn, string token, bool isBanned, string banReason);
}
}