@@ -86,70 +86,4 @@ private void Save(AuthenticationData data)
8686 {
8787 File . WriteAllText ( ConfigPath , _jsonSerializer . Serialize ( data ) ) ;
8888 }
89- }
90-
91-
92- //public class AuthenticationManager : IAuthenticationManager
93- //{
94- // private const string ConfigPath = "config.json";
95- // private readonly IJsonSerializer _jsonSerializer;
96- // private readonly IJsonDeserializer _jsonDeserializer;
97-
98- // public AuthenticationManager(IJsonSerializer jsonSerializer, IJsonDeserializer jsonDeserializer)
99- // {
100- // _jsonSerializer = jsonSerializer;
101- // _jsonDeserializer = jsonDeserializer;
102- // }
103-
104- // public bool IsLoggedIn => File.Exists(ConfigPath) && Load() is { } data && (
105- // data.Type == AuthenticationType.Basic || data.Expiry is null || data.Expiry > DateTime.UtcNow
106- // );
107-
108- // public bool IsBasicAuthenticationUsed => File.Exists(ConfigPath) && Load() is { } data &&
109- // data.Type == AuthenticationType.Basic;
110-
111- // public AuthenticationData LoginBasic(string username, string password)
112- // {
113- // var data = new AuthenticationData
114- // {
115- // Type = AuthenticationType.Basic,
116- // Username = username,
117- // Password = password
118- // };
119- // Save(data);
120- // return data;
121- // }
122-
123- // public AuthenticationData LoginBearer(string token)
124- // {
125- // var data = new AuthenticationData
126- // {
127- // Type = AuthenticationType.Bearer,
128- // AccessToken = token,
129- // Expiry = DateTime.UtcNow.AddHours(1)
130- // };
131- // Save(data);
132- // return data;
133- // }
134-
135- // public AuthenticationData? GetData()
136- // {
137- // return Load();
138- // }
139-
140- // public void Logout()
141- // {
142- // if (File.Exists(ConfigPath)) File.Delete(ConfigPath);
143- // }
144-
145- // private AuthenticationData? Load()
146- // {
147- // if (!File.Exists(ConfigPath)) return null;
148- // return _jsonDeserializer.Deserialize<AuthenticationData>(File.ReadAllText(ConfigPath));
149- // }
150-
151- // private void Save(AuthenticationData data)
152- // {
153- // File.WriteAllText(ConfigPath, _jsonSerializer.Serialize(data));
154- // }
155- //}
89+ }
0 commit comments