Allow adding u2f keys after sign in with key

This commit is contained in:
Jonas Lochmann
2022-09-19 02:00:00 +02:00
parent d8bed91dbc
commit bb58fd6a9b
2 changed files with 2 additions and 9 deletions
@@ -18,20 +18,13 @@
import { AddParentU2fKeyAction } from '../../../../action'
import { getU2fKeyId } from '../../../../database/u2fkey'
import { Cache } from '../cache'
import { ApplyActionUnacceptableAuthMethodException } from '../exception/auth'
import { LimitReachedException } from '../exception/limit'
import { AuthenticationMethod } from '../types'
export async function dispatchAddU2f ({ action, cache, parentUserId, authentication }: {
export async function dispatchAddU2f ({ action, cache, parentUserId }: {
action: AddParentU2fKeyAction
cache: Cache
parentUserId: string
authentication: AuthenticationMethod
}) {
if (authentication === 'u2f') {
throw new ApplyActionUnacceptableAuthMethodException()
}
const counter = await cache.database.u2fKey.count({
where: {
familyId: cache.familyId
@@ -158,7 +158,7 @@ export const dispatchParentAction = async ({
if (action instanceof AddCategoryNetworkIdAction) {
return dispatchAddCategoryNetworkId({ action, cache })
} else if (action instanceof AddParentU2fKeyAction) {
return dispatchAddU2f({ action, cache, parentUserId, authentication })
return dispatchAddU2f({ action, cache, parentUserId })
} else if (action instanceof AddUserAction) {
return dispatchAddUser({ action, cache })
} else if (action instanceof RemoveCategoryAppsAction) {