import requests


class LoginApi:
    def __init__(self, email: str, password: str):
        self.email = email
        self.password = password
        self.api_basepath = "http://127.0.0.1:8090/api"
        self.login_endpoing = "/admins/auth-via-email"

    def login(self):
        credentials = {"email": self.email, "password": self.password}
        print(self.api_basepath + self.login_endpoing)
        res = requests.post(self.api_basepath +
                            self.login_endpoing, credentials)
        return res.json()
