<?php

namespace App\Repositories\Auth;

use GuzzleHttp\Client as GuzzleHttpClient;

class EmailRepository
{
    /**
     * Get data from sso.
     *
     * @param  varchar  $email
     * @return \Illuminate\Http\Response
     */
    public function checkEmail($email)
    {
        $clientSso = new GuzzleHttpClient();
        $apiRequestSso = $clientSso->request('GET', 'https://sso.unesa.ac.id/userid/'.$email);
        $checkEmail = json_decode($apiRequestSso->getBody()->getContents());

        return $checkEmail;
    }
}
