Laragear / WebAuthn

Authenticate users with Passkeys: fingerprints, patterns and biometric data.
MIT License
305 stars 37 forks source link

[3.x] Fix: Retrieve Challenge pipeline #93

Closed Ghostscypher closed 2 months ago

Ghostscypher commented 2 months ago

This fixes an issue in the RetrieveChallenge.php where challenge validation always failed

Description

This fix allows the retrieve challenge pipeline to correctly compare the challenge

Code samples

  /**
     * Handle the incoming Assertion Validation.
     */
    public function handle(AttestationValidation|AssertionValidation $validation, Closure $next): mixed
    {
        if ($validation->challenge == $this->challenge->pull($validation)) {
            return $next($validation);
        }

        static::throw($validation, 'Challenge does not exist.');
    }