Updates as I integrate
This commit is contained in:
@@ -8,15 +8,18 @@ import { TokenType } from '../../constants/tokens';
|
||||
import { Status } from '../../constants/auth';
|
||||
import { Action } from '../../constants/action';
|
||||
|
||||
type CreateProps = Pick<AuthProps, 'record' | 'username'> & {
|
||||
type CreateProps = Pick<AuthProps, 'username'> & {
|
||||
externalId?: string;
|
||||
handle?: AuthProps['handle'];
|
||||
password?: string;
|
||||
publicKey?: string;
|
||||
record?: AuthProps['record'];
|
||||
};
|
||||
|
||||
export const create = async ({ record, username, externalId, password, publicKey }: CreateProps) => {
|
||||
export const create = async ({ record, username, externalId, handle, password, publicKey }: CreateProps) => {
|
||||
const status = REQUIRE_VERIFICATION ? Status.UNVERIFIED : Status.ACTIVE;
|
||||
const doc = await Auth.create({
|
||||
handle,
|
||||
record,
|
||||
status,
|
||||
username,
|
||||
@@ -55,7 +58,7 @@ export const create = async ({ record, username, externalId, password, publicKey
|
||||
return null;
|
||||
};
|
||||
|
||||
export type Fido2UserProps = Pick<AuthProps, 'record' | 'username'> & { externalId: string; publicKey: string };
|
||||
export type Fido2UserProps = Pick<AuthProps, 'handle' | 'username'> & { externalId: string; publicKey: string };
|
||||
export const createFido2User = (props: Fido2UserProps) => create(props);
|
||||
|
||||
export type LocalUserProps = Pick<AuthProps, 'record' | 'username'> & { password: string };
|
||||
|
||||
Reference in New Issue
Block a user