user()->hasRole(SystemRole::TenantAdmin->value), 403); $data = $request->validate(['current_password' => ['required', 'string']]); if (! Hash::check($data['current_password'], $request->user()->password)) { throw ValidationException::withMessages(['current_password' => 'Password login tidak sesuai.']); } $setting = TenantDeviceSetting::where('tenant_id', $request->user()->tenant_id)->firstOrFail(); Log::notice('Tenant Admin revealed the base device password.', [ 'tenant_id' => $request->user()->tenant_id, 'user_id' => $request->user()->id, ]); return response()->json(['password' => $setting->base_password]) ->header('Cache-Control', 'no-store, private') ->header('Pragma', 'no-cache'); } }