Refactor api.accounts to api.auth

This commit is contained in:
Niko 2022-02-15 21:41:55 +01:00
parent fff0dfa7d1
commit c2b4cac30f
4 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
module.exports = {
url: require('./api-utils.js').url,
accounts: require('./api/accounts.js'),
auth: require('./api/auth.js'),
feed: require('./api/feed.js'),
}

View File

@ -66,8 +66,8 @@ app.on('apex-outbox', activity.federation.outbox)
app.on('apex-inbox', activity.federation.inbox)
// API defines
app.route(api.url('/accounts/register')).post(api.accounts.register.post)
app.route(api.url('/accounts/login')).post(api.accounts.login.post)
app.route(api.url('/auth/register')).post(api.auth.register.post)
app.route(api.url('/auth/login')).post(api.auth.login.post)
app.route(api.url('/feed/meet')).get(api.feed.meet.get)

View File

@ -27,7 +27,7 @@ function loginAction(e) {
email: e.target.querySelector('*[name="email"]').value,
password: e.target.querySelector('*[name="password"]').value,
};
http.post('/api/v1/accounts/login', payload, function(json) {
http.post('/api/v1/auth/login', payload, function(json) {
if (json.error !== undefined)
console.error('TODO: to-screen: '+json.error);
else if (json.result !== undefined && json.result === 1)