kreait / firebase-php

@@ -649,6 +649,38 @@
Loading
649 649
        }
650 650
    }
651 651
652 +
    /**
653 +
     * Confirm email verification.
654 +
     *
655 +
     * @param Uid|Email|string $uidOrEmail the user whose tokens are to be revoked
656 +
     *
657 +
     * @throws UserNotFound
658 +
     * @throws UserDisabled
659 +
     * @throws ExpiredOobCode
660 +
     * @throws InvalidOobCode
661 +
     * @throws OperationNotAllowed
662 +
     * @throws Exception\AuthException
663 +
     * @throws Exception\FirebaseException
664 +
     */
665 +
    public function confirmEmailVerification($uidOrEmail, string $oobCode): void
666 +
    {
667 +
        if (\is_string($uidOrEmail)) {
668 +
            try {
669 +
                $uidOrEmail = new Email($uidOrEmail);
670 +
            } catch (\InvalidArgumentException $e) {
671 +
                $uidOrEmail = new Uid((string) $uidOrEmail);
672 +
            }
673 +
        }
674 +
675 +
        if ($uidOrEmail instanceof Email) {
676 +
            $uid = $this->getUserByEmail($uidOrEmail)->uid;
677 +
        } else {
678 +
            $uid = $uidOrEmail;
679 +
        }
680 +
681 +
        $this->client->confirmEmailVerification((string) $uid, $oobCode);
682 +
    }
683 +
652 684
    /**
653 685
     * Revokes all refresh tokens for the specified user identified by the uid provided.
654 686
     * In addition to revoking all refresh tokens for a user, all ID tokens issued

@@ -163,6 +163,20 @@
Loading
163 163
        ]);
164 164
    }
165 165
166 +
    /**
167 +
     * @throws ExpiredOobCode
168 +
     * @throws InvalidOobCode
169 +
     * @throws OperationNotAllowed
170 +
     * @throws UserDisabled
171 +
     */
172 +
    public function confirmEmailVerification(string $uid, string $oobCode): ResponseInterface
173 +
    {
174 +
        return $this->requestApi('https://identitytoolkit.googleapis.com/v1/accounts:update', [
175 +
            'oobCode' => $oobCode,
176 +
            'localId' => $uid,
177 +
        ]);
178 +
    }
179 +
166 180
    /**
167 181
     * @throws AuthException
168 182
     * @throws FirebaseException
Files Complexity Coverage
src/Firebase 1,413 68.04%
Project Totals (147 files) 1413 68.04%
1
comment:
2
  layout: "reach,diff"
3

4
coverage:
5
  status:
6
    project:
7
      default:
8
        informational: true
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading