Updates as I integrate

This commit is contained in:
2023-05-30 17:44:50 -04:00
parent ec61e29fb0
commit 64e1f53f4e
7 changed files with 19 additions and 11 deletions

View File

@@ -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 };