diff options
| author | Henry Jameson <me@hjkos.com> | 2019-05-21 23:35:40 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-05-21 23:35:40 +0300 |
| commit | fc12b63fcc41a06ee818428640f962fbea536e1f (patch) | |
| tree | f13668dc2b704d1cdd2e96ba0554d33e8b049bdc /src/services/api | |
| parent | 233506f6c1b0b16ca62c557ae6eca4a585e28a2c (diff) | |
mastoapi login works
Diffstat (limited to 'src/services/api')
| -rw-r--r-- | src/services/api/api.service.js | 6 |
1 files changed, 3 insertions, 3 deletions
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)) } |
