Fix admin creation logic

This commit is contained in:
Zoe Roux 2024-02-13 15:55:26 +01:00
parent 6139deb175
commit 973685ec08

View File

@ -106,7 +106,7 @@ namespace Kyoo.Authentication.Views
User user = request.ToUser();
user.Permissions = permissions.NewUser;
// If no users exists, the new one will be an admin. Give it every permissions.
if ((await users.GetAll(limit: new Pagination(1))).Any())
if (!(await users.GetAll(limit: new Pagination(1))).Any())
user.Permissions = PermissionOption.Admin;
try
{