diff --git a/csharp/App/Backend/DataTypes/Methods/Session.cs b/csharp/App/Backend/DataTypes/Methods/Session.cs index 52683e16f..7d626a218 100644 --- a/csharp/App/Backend/DataTypes/Methods/Session.cs +++ b/csharp/App/Backend/DataTypes/Methods/Session.cs @@ -148,12 +148,13 @@ public static class SessionMethods && Db.Delete(installation); } - public static Boolean Create(this Session? session, User? newUser) + public static Boolean Create(this Session? session, User newUser) { var sessionUser = session?.User; + var userAlreadyExists = Db.GetUserByEmail(newUser.Email); return sessionUser is not null - && newUser is not null + && userAlreadyExists is null && sessionUser.HasWriteAccess && newUser .WithParent(sessionUser)