remove password reset
This commit is contained in:
parent
d2dcdfbd80
commit
ecfea5c5e3
2 changed files with 10 additions and 23 deletions
|
|
@ -14,9 +14,11 @@ import {
|
||||||
import { RegistrationError, StatusCodeError } from 'src/services/errors/errors'
|
import { RegistrationError, StatusCodeError } from 'src/services/errors/errors'
|
||||||
|
|
||||||
const SUGGESTIONS_URL = '/api/v1/suggestions'
|
const SUGGESTIONS_URL = '/api/v1/suggestions'
|
||||||
/* eslint-env browser */
|
|
||||||
const MASTODON_LOGIN_URL = '/api/v1/accounts/verify_credentials'
|
const MASTODON_LOGIN_URL = '/api/v1/accounts/verify_credentials'
|
||||||
const MASTODON_REGISTRATION_URL = '/api/v1/accounts'
|
const MASTODON_REGISTRATION_URL = '/api/v1/accounts'
|
||||||
|
const MASTODON_PASSWORD_RESET_URL = ({ email }) =>
|
||||||
|
`/auth/password${paramsString({ email })}`
|
||||||
|
|
||||||
const MASTODON_USER_FAVORITES_TIMELINE_URL = '/api/v1/favourites'
|
const MASTODON_USER_FAVORITES_TIMELINE_URL = '/api/v1/favourites'
|
||||||
const MASTODON_USER_NOTIFICATIONS_URL = '/api/v1/notifications'
|
const MASTODON_USER_NOTIFICATIONS_URL = '/api/v1/notifications'
|
||||||
const MASTODON_FOLLOWING_URL = (
|
const MASTODON_FOLLOWING_URL = (
|
||||||
|
|
@ -313,6 +315,13 @@ export const verifyCredentials = ({ credentials }) =>
|
||||||
credentials,
|
credentials,
|
||||||
}).then(({ data, ...rest }) => ({ ...rest, data: parseUser(data) }))
|
}).then(({ data, ...rest }) => ({ ...rest, data: parseUser(data) }))
|
||||||
|
|
||||||
|
export const resetPassword = ({ instance, email }) => {
|
||||||
|
return promisedRequest({
|
||||||
|
url: MASTODON_PASSWORD_RESET_URL({ email }),
|
||||||
|
method: 'POST',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export const suggestions = ({ credentials }) =>
|
export const suggestions = ({ credentials }) =>
|
||||||
promisedRequest({
|
promisedRequest({
|
||||||
url: SUGGESTIONS_URL,
|
url: SUGGESTIONS_URL,
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
import { reduce } from 'lodash'
|
|
||||||
|
|
||||||
const MASTODON_PASSWORD_RESET_URL = '/auth/password'
|
|
||||||
|
|
||||||
const resetPassword = ({ instance, email }) => {
|
|
||||||
const params = { email }
|
|
||||||
const query = reduce(
|
|
||||||
params,
|
|
||||||
(acc, v, k) => {
|
|
||||||
const encoded = `${k}=${encodeURIComponent(v)}`
|
|
||||||
return `${acc}&${encoded}`
|
|
||||||
},
|
|
||||||
'',
|
|
||||||
)
|
|
||||||
const url = `${instance}${MASTODON_PASSWORD_RESET_URL}?${query}`
|
|
||||||
|
|
||||||
return window.fetch(url, {
|
|
||||||
method: 'POST',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export default resetPassword
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue