-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5a254d
commit 4c9bb4a
Showing
9 changed files
with
50 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
namespace ReadyPlayerMe.AvatarCreator | ||
{ | ||
public abstract class AuthEndpoints : Endpoints | ||
public abstract class AuthEndpoints | ||
{ | ||
public static string GetAuthAnonymousEndpoint(string subdomain) | ||
{ | ||
return string.Format(API_SUBDOMAIN_ENDPOINT, subdomain, "/users"); | ||
return string.Format(Env.RPM_API_SUBDOMAIN_URL, subdomain, "/users"); | ||
} | ||
|
||
public static string GetAuthStartEndpoint(string subdomain) | ||
{ | ||
return string.Format(API_SUBDOMAIN_ENDPOINT, subdomain, "/auth/start"); | ||
return string.Format(Env.RPM_API_SUBDOMAIN_URL, subdomain, "/auth/start"); | ||
} | ||
|
||
public static string GetConfirmCodeEndpoint(string subdomain) | ||
{ | ||
return string.Format(API_SUBDOMAIN_ENDPOINT, subdomain, "/auth/login"); | ||
return string.Format(Env.RPM_API_SUBDOMAIN_URL, subdomain, "/auth/login"); | ||
} | ||
|
||
public static string GetTokenRefreshEndpoint(string subdomain) | ||
{ | ||
return string.Format(API_SUBDOMAIN_ENDPOINT, subdomain, "/auth/refresh"); | ||
return string.Format(Env.RPM_API_SUBDOMAIN_URL, subdomain, "/auth/refresh"); | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace ReadyPlayerMe.AvatarCreator | ||
{ | ||
public static class Env | ||
{ | ||
public static string RPM_API_SUBDOMAIN_URL => EnvLoader.LoadVar(nameof(RPM_API_SUBDOMAIN_URL), "https://{0}.readyplayer.me/api{1}"); | ||
public static string RPM_API_V2_URL => EnvLoader.LoadVar(nameof(RPM_API_V2_URL), "https://api.readyplayer.me/v2/"); | ||
public static string RPM_API_V1_URL => EnvLoader.LoadVar(nameof(RPM_API_V1_URL), "https://api.readyplayer.me/v1/"); | ||
} | ||
} |
File renamed without changes.
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,19 @@ | ||
using Newtonsoft.Json.Linq; | ||
using UnityEngine; | ||
|
||
namespace ReadyPlayerMe.AvatarCreator | ||
{ | ||
public static class EnvLoader | ||
{ | ||
private const string LOCAL_ENV_FILENAME = "env.local"; | ||
|
||
public static string LoadVar(string varName, string defaultValue) | ||
{ | ||
var jsonContent = Resources.Load<TextAsset>(LOCAL_ENV_FILENAME); | ||
|
||
var loadedEnv = JObject.Parse(jsonContent.text); | ||
|
||
return loadedEnv[varName]?.ToString() ?? defaultValue; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.