src/A1comms/GaeSupportLaravel/Auth/Guard/Firebase_Guard.php
/**
     * Authenticate a user based on request information,
     * return a valid user object if successful, or null.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Contracts\Auth\Authenticatable|null
     */
Authenticate a user based on request information,
return a valid user object if successful, or null.


Authenticate a user based on request information return a valid user object if successful or null .
public static function validate(Request $request, UserProvider $provider = null)
    {
        $expected_audience = env('FIREBASE_PROJECT');
        if (empty($expected_audience)) {
            throw new Exception("Firebase Authentication Guard: Audience (env FIREBASE_PROJECT) not defined");
        }
        $jwt = $request->cookie(config('gaesupport.auth.firebase.cookie_name'));
        if (empty($jwt)) {
            return null;
        }
        try {
            $return = Firebase::validateToken($jwt, $expected_audience);
        } catch (InvalidTokenException $e) {
            Log::warning('Firebase Authentication Guard: ' . $e->getMessage());
            return null;
        }
        return static::returnUser($provider, $return);
    }
public static function validate ( Request $ request , UserProvider $ provider = null ) { $ expected_audience = env ( 'FIREBASE_PROJECT' ) ; if ( empty ( $ expected_audience ) ) { throw new Exception ( " Firebase Authentication Guard: Audience (env FIREBASE_PROJECT) not defined " ) ; } $ jwt = $ request -> cookie ( config ( 'gaesupport.auth.firebase.cookie_name' ) ) ; if ( empty ( $ jwt ) ) { return null ; } try { $ return = Firebase :: validateToken ( $ jwt , $ expected_audience ) ; } catch ( InvalidTokenException $ e ) { Log :: warning ( 'Firebase Authentication Guard: ' . $ e -> getMessage ( ) ) ; return null ; } return static :: returnUser ( $ provider , $ return ) ; }
Authenticate a user based on request information,
 return a valid user object if successful, or null.
Authenticate a user based on request information return a valid user object if successful or null .