23 lines
540 B
Python
23 lines
540 B
Python
from flask import Blueprint
|
|
from controllers import AuthController
|
|
|
|
# Inisialisasi blueprint
|
|
auth_blueprint = Blueprint("auth", __name__)
|
|
auth_controller = AuthController()
|
|
|
|
|
|
# Daftarkan rute ke controller
|
|
@auth_blueprint.route("/register", methods=["POST"])
|
|
def register():
|
|
return auth_controller.register()
|
|
|
|
|
|
@auth_blueprint.route("/login", methods=["POST"])
|
|
def login():
|
|
return auth_controller.login()
|
|
|
|
|
|
@auth_blueprint.route("/logout", methods=["DELETE"])
|
|
def logout():
|
|
return auth_controller.logout()
|