Refactor api.accounts to api.auth
This commit is contained in:
parent
fff0dfa7d1
commit
c2b4cac30f
|
@ -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'),
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue