"use strict";

const Promise = require("bluebird");
const axios = require("axios");

module.exports = function createLoginAgent({ homeserver }) {
	return {
		getMethods: function () {
			return Promise.try(() => {
				// axios get /login
			}).then((response) => {
				// extract available login methods
			});
		},
		login: function ({ token, username, password }) {
			// validate either token or (username, password) supplied
			return Promise.try(() => {
				// axios post /login
			}).then((response) => {
				// TODO
			});
		}
	};
};
