diff --git a/Backend/Sources/BackendApp/Model/Authentication/User/User.swift b/Backend/Sources/BackendApp/Model/Authentication/User/User.swift index 6745a35..18b862a 100644 --- a/Backend/Sources/BackendApp/Model/Authentication/User/User.swift +++ b/Backend/Sources/BackendApp/Model/Authentication/User/User.swift @@ -57,6 +57,7 @@ extension User { .field("email", .string, .required) .unique(on: "email") .field("password", .string, .required) + .field("social_id", .string) .create() } @@ -85,7 +86,7 @@ extension User { } static func uniqueness(forEmail email: String, on request: Request) async throws -> Bool { - return try await User.isExisting(matching: \.$email == email, on: request.db) + return try await !User.isExisting(matching: \.$email == email, on: request.db) } static func ensureUniqueness(for registrant: User, on request: Request) async throws { diff --git a/Backend/Tests/BackendAppTests/AppTests.swift b/Backend/Tests/BackendAppTests/AppTests.swift index cfce2e4..d868cae 100755 --- a/Backend/Tests/BackendAppTests/AppTests.swift +++ b/Backend/Tests/BackendAppTests/AppTests.swift @@ -1,4 +1,4 @@ -import App +import BackendApp import Dispatch import XCTest