refactor(identity): change receiver of OauthUtils.ExpandScopes()
This commit is contained in:
parent
00a54f4f8b
commit
8bd118ea67
4 changed files with 13 additions and 14 deletions
|
@ -6,7 +6,10 @@ namespace Foxchat.Identity.Utils;
|
|||
|
||||
public static class OauthUtils
|
||||
{
|
||||
public static readonly string[] Scopes = ["identify", "chat_client"];
|
||||
public const string ClientCredentials = "client_credentials";
|
||||
public const string AuthorizationCode = "authorization_code";
|
||||
|
||||
public static readonly string[] Scopes = ["identify", "email", "guilds", "chat_client"];
|
||||
|
||||
private static readonly string[] ForbiddenSchemes = ["javascript", "file", "data", "mailto", "tel"];
|
||||
private const string OobUri = "urn:ietf:wg:oauth:2.0:oob";
|
||||
|
@ -25,11 +28,7 @@ public static class OauthUtils
|
|||
}
|
||||
}
|
||||
|
||||
public static string[] ExpandScopes(this Token token) => token.Scopes.Contains("chat_client")
|
||||
public static string[] ExpandScopes(this string[] scopes) => scopes.Contains("chat_client")
|
||||
? Scopes
|
||||
: token.Scopes;
|
||||
|
||||
public static string[] ExpandScopes(this Application app) => app.Scopes.Contains("chat_client")
|
||||
? Scopes
|
||||
: app.Scopes;
|
||||
: scopes;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue