"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleApplication = handleApplication;
const Resource_ts_1 = require("./Resource.js");
function handleApplication(scope) {
    scope.resources.set('login', Login);
    scope.resources.loginPath = (request) => {
        return '/login?redirect=' + encodeURIComponent(request.url);
    };
}
// @ts-ignore
class Login extends Resource_ts_1.Resource {
    static async get(_id, _body, _request) {
        // TODO: Return a login page
    }
    static async post(_id, body, request) {
        const { username, password } = body;
        return {
            data: await request.login(username, password),
        };
    }
}
//# sourceMappingURL=login.js.map