From 4a5307842c3c28b931ae809ff0364454ad681f5a Mon Sep 17 00:00:00 2001 From: "oura.a" Date: Mon, 15 May 2023 02:30:32 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20104:=20=E3=83=A6=E3=83=BC?= =?UTF-8?q?=E3=82=B6=E4=BD=9C=E6=88=90API=E5=91=BC=E3=81=B3=E5=87=BA?= =?UTF-8?q?=E3=81=97=E6=99=82=E3=81=AB=E3=80=81=E3=82=A2=E3=82=AF=E3=82=BB?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=BC=E3=82=AF=E3=83=B3=E3=82=92=E6=B8=A1?= =?UTF-8?q?=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task1745: ユーザ作成API呼び出し時に、アクセストークンを渡すように修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1745) タスク 1745: ユーザ作成API呼び出し時に、アクセストークンを渡すように修正 ユーザ作成API4(signup)呼び出し時の引数にアクセストークンを追加。 (/app/dictation_client/src/features/user/operations.ts) ## レビューポイント アクセストークンの渡し方が正しいかどうか 不足している処理はないか ## UIの変更 なし ## 動作確認状況 ローカルでの動作確認にてheader内にauthorizationが追加されたことを確認 ## 補足 なし --- .../src/features/user/operations.ts | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/dictation_client/src/features/user/operations.ts b/dictation_client/src/features/user/operations.ts index 6ef9645..c364a0c 100644 --- a/dictation_client/src/features/user/operations.ts +++ b/dictation_client/src/features/user/operations.ts @@ -65,21 +65,26 @@ export const addUserAsync = createAsyncThunk< // apiのConfigurationを取得する const { getState } = thunkApi; const state = getState() as RootState; - const { configuration } = state.auth; + const { configuration, accessToken } = state.auth; const config = new Configuration(configuration); const usersApi = new UsersApi(config); try { - await usersApi.signup({ - name, - email, - role, - authorId, - typistGroupId, - autoRenew, - licenseAlert, - notification, - }); + await usersApi.signup( + { + name, + email, + role, + authorId, + typistGroupId, + autoRenew, + licenseAlert, + notification, + }, + { + headers: { authorization: `Bearer ${accessToken}` }, + } + ); thunkApi.dispatch( openSnackbar({ level: "info",