mirror of
https://github.com/wassname/talk.git
synced 2026-07-09 11:12:44 +08:00
fix: missed users service
This commit is contained in:
@@ -67,7 +67,7 @@ export const signup = ({ db }: SignupOptions): RequestHandler => async (
|
||||
};
|
||||
|
||||
// Create the new user.
|
||||
const user = await create(db, tenant.id, {
|
||||
const user = await create(db, tenant, {
|
||||
email,
|
||||
username,
|
||||
displayName,
|
||||
|
||||
@@ -63,7 +63,7 @@ export async function findOrCreateOIDCUser(
|
||||
// FIXME: implement rules.
|
||||
|
||||
// Create the new user, as one didn't exist before!
|
||||
user = await create(db, tenant.id, {
|
||||
user = await create(db, tenant, {
|
||||
username: null,
|
||||
role: GQLUSER_ROLE.COMMENTER,
|
||||
email,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Db } from "mongodb";
|
||||
|
||||
import { Tenant } from "talk-server/models/tenant";
|
||||
import { createUser, CreateUserInput } from "talk-server/models/user";
|
||||
|
||||
export type CreateUser = CreateUserInput;
|
||||
|
||||
export async function create(db: Db, tenantID: string, input: CreateUser) {
|
||||
const user = await createUser(db, tenantID, input);
|
||||
export async function create(db: Db, tenant: Tenant, input: CreateUser) {
|
||||
const user = await createUser(db, tenant.id, input);
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user