chore: Add actor type check + more tests (#10005)
This commit is contained in:
@@ -43,15 +43,15 @@ export class EmailPassAuthService extends AbstractAuthModuleProvider {
|
||||
}
|
||||
|
||||
async update(
|
||||
data: { email: string; password: string },
|
||||
data: { password: string; entity_id: string },
|
||||
authIdentityService: AuthIdentityProviderService
|
||||
) {
|
||||
const { email, password } = data ?? {}
|
||||
const { password, entity_id } = data ?? {}
|
||||
|
||||
if (!email || !isString(email)) {
|
||||
if (!entity_id) {
|
||||
return {
|
||||
success: false,
|
||||
error: `Cannot update ${this.provider} provider identity without email`,
|
||||
error: `Cannot update ${this.provider} provider identity without entity_id`,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ export class EmailPassAuthService extends AbstractAuthModuleProvider {
|
||||
try {
|
||||
const passwordHash = await this.hashPassword(password)
|
||||
|
||||
authIdentity = await authIdentityService.update(email, {
|
||||
authIdentity = await authIdentityService.update(entity_id, {
|
||||
provider_metadata: {
|
||||
password: passwordHash,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user