fix(api): generate token if needed in discord oauth response

This commit is contained in:
spiral 2022-06-16 17:51:53 -04:00
parent 9848b88d5b
commit 62c5c3865a
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E

View File

@ -135,6 +135,9 @@ public class PrivateController: PKControllerBase
// guilds.Select(g => new HashEntry(g.Value<string>("id"), true)).ToArray()
// );
if (system.Token == null)
system = await _repo.UpdateSystem(system.Id, new SystemPatch { Token = StringUtils.GenerateToken() });
var o = new JObject();
o.Add("system", system.ToJson(LookupContext.ByOwner));