|
1 | 1 | using Newtonsoft.Json; |
| 2 | +using Newtonsoft.Json.Converters; |
2 | 3 | using System; |
3 | 4 | using System.Collections.Generic; |
4 | 5 | using System.Text; |
@@ -28,12 +29,12 @@ public enum BuildEnv |
28 | 29 |
|
29 | 30 | public enum ThemeModes |
30 | 31 | { |
31 | | - LIGHT, DARK, AUTO |
| 32 | + light, dark, auto |
32 | 33 | } |
33 | 34 |
|
34 | 35 | public enum Language |
35 | 36 | { |
36 | | - EN, DE, JA, KO, ZH, ES, FR, PT, NL |
| 37 | + en, de, ja, ko, zh, es, fr, pt, nl |
37 | 38 | } |
38 | 39 |
|
39 | 40 | private Web3AuthOptions web3AuthOptions; |
@@ -89,27 +90,31 @@ public void Awake() |
89 | 90 |
|
90 | 91 | public void setOptions(Web3AuthOptions web3AuthOptions) |
91 | 92 | { |
| 93 | + JsonSerializerSettings settings = new JsonSerializerSettings |
| 94 | + { |
| 95 | + Converters = new List<JsonConverter> { new StringEnumConverter() }, |
| 96 | + Formatting = Formatting.Indented |
| 97 | + }; |
92 | 98 |
|
93 | 99 | this.web3AuthOptions = web3AuthOptions; |
94 | 100 |
|
95 | 101 | if (this.web3AuthOptions.redirectUrl != null) |
96 | 102 | this.initParams["redirectUrl"] = this.web3AuthOptions.redirectUrl; |
97 | 103 |
|
98 | 104 | if (this.web3AuthOptions.whiteLabel != null) |
99 | | - this.initParams["whiteLabel"] = JsonConvert.SerializeObject(this.web3AuthOptions.whiteLabel); |
| 105 | + this.initParams["whiteLabel"] = JsonConvert.SerializeObject(this.web3AuthOptions.whiteLabel, settings); |
100 | 106 |
|
101 | 107 | if (this.web3AuthOptions.loginConfig != null) |
102 | | - this.initParams["loginConfig"] = JsonConvert.SerializeObject(this.web3AuthOptions.loginConfig); |
| 108 | + this.initParams["loginConfig"] = JsonConvert.SerializeObject(this.web3AuthOptions.loginConfig, settings); |
103 | 109 |
|
104 | 110 | if (this.web3AuthOptions.clientId != null) |
105 | 111 | this.initParams["clientId"] = this.web3AuthOptions.clientId; |
106 | 112 |
|
107 | | - if (this.web3AuthOptions.clientId != null) |
| 113 | + if (this.web3AuthOptions.clientId != null) |
108 | 114 | this.initParams["buildEnv"] = this.web3AuthOptions.buildEnv.ToString().ToLower(); |
109 | 115 |
|
110 | 116 | this.initParams["network"] = this.web3AuthOptions.network.ToString().ToLower(); |
111 | 117 |
|
112 | | - |
113 | 118 | if (this.web3AuthOptions.useCoreKitKey.HasValue) |
114 | 119 | this.initParams["useCoreKitKey"] = this.web3AuthOptions.useCoreKitKey.Value; |
115 | 120 |
|
|
0 commit comments