 extension User: UserClaimRepresentable {
     public func makeUserClaim() throws -> UserClaim {
         return UserClaim(try Node(node: [
-            // TODO: is this the right way to handle the optional id?
             "id": self.id ?? "",
-            "email": self.email,
-            "password": self.password,
             ]))
     }
 }
+
+extension User: Storable {
+    public static let name = "user"
+
+    public var node: Node {
+        return id?.makeNode(in: nil) ?? ""
+    }
+}
+
+public struct UserIdentifier: JSONInitializable {
+    let id: Identifier
+
+    public init(json: JSON) throws {
+        id = Identifier(try json.get(User.name) as Node)
+    }
+}
+
+extension User: PayloadAuthenticatable {
+    public typealias PayloadType = UserIdentifier
+
+    public static func authenticate(_ payload: PayloadType) throws -> User {
+        guard let user = try User.find(payload.id) else {
+            throw Abort.init(.badRequest, reason: "User not found")
+        }
+
+        return user
+    }
+}

    }

    public init(row: Row) throws {
        self.id = try row.get("id")
        self.name = try row.get("name")
        self.email = try row.get("email")
        self.password = try row.get("password")

public final class User: Model {
    public let storage = Storage()

    public var exists: Bool = false

    public var name: String?
