from flask import Blueprint
from app.controllers import AuthController
from app.di_container import Container
from dependency_injector.wiring import inject, Provide


auth_blueprint = Blueprint("auth", __name__)


@auth_blueprint.route("/login", methods=["POST"])
@inject
def login(auth_controller: AuthController = Provide[Container.auth_controller]):
    return auth_controller.login()


@auth_blueprint.route("/login/google", methods=["POST"])
@inject
def google_login(auth_controller: AuthController = Provide[Container.auth_controller]):
    return auth_controller.google_login()


@auth_blueprint.route("/logout", methods=["DELETE"])
@inject
def logout(auth_controller: AuthController = Provide[Container.auth_controller]):
    return auth_controller.logout()
