<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StravaCallbackRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    /**
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'code' => ['required_without:error', 'string'],
            'error' => ['nullable', 'string'],
            'scope' => ['nullable', 'string'],
            'state' => ['required', 'string'],
        ];
    }
}
