You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace App\Http\Controllers\Web\Auth;
-
- use App\Http\Controllers\Web\WebController;
- use App\Logic\PasswordSettingManager;
- use Illuminate\Http\JsonResponse;
- use Illuminate\Http\Request;
-
- class PasswordSettingVerifyController extends WebController
- {
-
- public function name(): string
- {
- return "パスワード設定認証";
- }
-
- public function description(): string
- {
- return "パスワード設定手続きを認証する";
- }
-
- public function __construct(protected PasswordSettingVerifyParam $param, private PasswordSettingManager $manager)
- {
- parent::__construct();
- }
-
- protected function run(Request $request): JsonResponse
- {
- $param = $this->param;
-
- $users = $this->manager->verify($param->token);
- if ($users === null) {
- return $this->failedResponse();
- }
-
- foreach ($users as $user) {
- $user->password = $param->password;
- $user->save();
- }
-
- return $this->successResponse();
- }
- }
|