diff --git a/dictation_server/src/gateways/adb2c/adb2c.service.ts b/dictation_server/src/gateways/adb2c/adb2c.service.ts index 088b847..1a81390 100644 --- a/dictation_server/src/gateways/adb2c/adb2c.service.ts +++ b/dictation_server/src/gateways/adb2c/adb2c.service.ts @@ -40,6 +40,7 @@ export class AdB2cService { const authProvider = new TokenCredentialAuthenticationProvider(credential, { scopes: ['https://graph.microsoft.com/.default'], }); + this.graphClient = Client.initWithMiddleware({ authProvider }); } @@ -143,21 +144,15 @@ export class AdB2cService { * @param externalId ユーザ情報 * @param password パスワード */ - async changePassword( - externalId: string, - password: string, - ): Promise<{ sub: string }> { + async changePassword(externalId: string, password: string): Promise { this.logger.log(`[IN] ${this.changePassword.name}`); try { // ADB2Cのユーザのパスワードを変更する - const changeUser = await this.graphClient - .api(`/users/${externalId}`) - .patch({ - passwordProfile: { - password: password, - }, - }); - return { sub: changeUser.id }; + await this.graphClient.api(`/users/${externalId}`).patch({ + passwordProfile: { + password: password, + }, + }); } catch (e) { this.logger.error(e); throw e;