GRAYBYTE WORDPRESS FILE MANAGER6883

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/public_html/Barga/application/third_party/Firebase/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/public_html/Barga/application/third_party/Firebase//Auth.php
<?php

namespace Kreait\Firebase;

use Kreait\Firebase\Auth\ApiClient;
use Kreait\Firebase\Auth\CustomTokenGenerator;
use Kreait\Firebase\Auth\IdTokenVerifier;
use Kreait\Firebase\Auth\User;
use Kreait\Firebase\Util\JSON;
use Lcobucci\JWT\Token;
use Psr\Http\Message\ResponseInterface;

class Auth
{
    /**
     * @var ApiClient
     */
    private $client;

    /**
     * @var CustomTokenGenerator
     */
    private $customToken;

    /**
     * @var IdTokenVerifier
     */
    private $idTokenVerifier;

    public function __construct(ApiClient $client, CustomTokenGenerator $customToken, IdTokenVerifier $idTokenVerifier)
    {
        $this->client = $client;
        $this->customToken = $customToken;
        $this->idTokenVerifier = $idTokenVerifier;
    }

    public function getApiClient(): ApiClient
    {
        return $this->client;
    }

    public function getUser($uid, array $claims = []): User
    {
        $response = $this->client->exchangeCustomTokenForIdAndRefreshToken(
            $this->createCustomToken($uid, $claims)
        );

        return $this->convertResponseToUser($response);
    }

    public function createUserWithEmailAndPassword(string $email, string $password): User
    {
        $response = $this->client->signupNewUser($email, $password);

        return $this->convertResponseToUser($response);
    }

    public function getUserByEmailAndPassword(string $email, string $password): User
    {
        $response = $this->client->getUserByEmailAndPassword($email, $password);

        return $this->convertResponseToUser($response);
    }

    public function createAnonymousUser(): User
    {
        return $this->createUserWithEmailAndPassword('', '');
    }

    public function changeUserPassword(User $user, string $newPassword): User
    {
        $response = $this->client->changeUserPassword($user, $newPassword);

        return $this->convertResponseToUser($response);
    }

    public function changeUserEmail(User $user, string $newEmail): User
    {
        $response = $this->client->changeUserEmail($user, $newEmail);

        return $this->convertResponseToUser($response);
    }

    public function deleteUser(User $user)
    {
        $this->client->deleteUser($user);
    }

    public function sendEmailVerification(User $user)
    {
        $this->client->sendEmailVerification($user);
    }

    public function sendPasswordResetEmail($userOrEmail)
    {
        $email = $userOrEmail instanceof User
            ? $userOrEmail->getUid()
            : (string) $userOrEmail;

        $this->client->sendPasswordResetEmail($email);
    }

    public function createCustomToken($uid, array $claims = [], \DateTimeInterface $expiresAt = null): Token
    {
        return $this->customToken->create($uid, $claims, $expiresAt);
    }

    public function verifyIdToken($idToken): Token
    {
        return $this->idTokenVerifier->verify($idToken);
    }

    private function convertResponseToUser(ResponseInterface $response): User
    {
        $data = JSON::decode((string) $response->getBody(), true);

        return User::create($data['idToken'], $data['refreshToken']);
    }
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 27 2024 00:19:25
giriqfky / giriqfky
0755
Auth
--
July 27 2024 00:19:25
giriqfky / giriqfky
0755
Database
--
July 27 2024 00:19:25
giriqfky / giriqfky
0755
Exception
--
July 27 2024 00:19:25
giriqfky / giriqfky
0755
Http
--
July 27 2024 00:19:25
giriqfky / giriqfky
0755
ServiceAccount
--
July 27 2024 00:19:25
giriqfky / giriqfky
0755
Util
--
July 27 2024 00:19:25
giriqfky / giriqfky
0755
Auth.php
3.086 KB
July 27 2024 00:19:25
giriqfky / giriqfky
0644
Database.php
3.816 KB
July 27 2024 00:19:25
giriqfky / giriqfky
0644
Factory.php
5.012 KB
July 27 2024 00:19:25
giriqfky / giriqfky
0644
ServiceAccount.php
3.793 KB
July 27 2024 00:19:25
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF