From fc12b63fcc41a06ee818428640f962fbea536e1f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 21 May 2019 23:35:40 +0300 Subject: mastoapi login works --- src/services/api/api.service.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/services/api/api.service.js') diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index c67eccf1..115c3296 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -1,5 +1,4 @@ /* eslint-env browser */ -const LOGIN_URL = '/api/account/verify_credentials.json' const REGISTRATION_URL = '/api/account/register.json' const BG_UPDATE_URL = '/api/qvitter/update_background_image.json' const EXTERNAL_PROFILE_URL = '/api/externalprofile/show.json' @@ -17,6 +16,7 @@ const ACTIVATION_STATUS_URL = screenName => `/api/pleroma/admin/users/${screenNa const ADMIN_USERS_URL = '/api/pleroma/admin/users' const SUGGESTIONS_URL = '/api/v1/suggestions' +const MASTODON_LOGIN_URL = '/api/v1/accounts/verify_credentials' const MASTODON_USER_FAVORITES_TIMELINE_URL = '/api/v1/favourites' const MASTODON_USER_NOTIFICATIONS_URL = '/api/v1/notifications' const MASTODON_FAVORITE_URL = id => `/api/v1/statuses/${id}/favourite` @@ -497,8 +497,7 @@ const fetchPinnedStatuses = ({ id, credentials }) => { } const verifyCredentials = (user) => { - return fetch(LOGIN_URL, { - method: 'POST', + return fetch(MASTODON_LOGIN_URL, { headers: authHeaders(user) }) .then((response) => { @@ -510,6 +509,7 @@ const verifyCredentials = (user) => { } } }) + .then((data) => data.error ? data : parseUser(data)) } -- cgit v1.2.3-70-g09d2