Mastodon: redirect password reset to backend
This commit is contained in:
@@ -24,6 +24,7 @@ export const getFeatures = createSelector([
|
||||
securityAPI: v.software === 'Pleroma',
|
||||
settingsStore: v.software === 'Pleroma',
|
||||
accountAliasesAPI: v.software === 'Pleroma',
|
||||
resetPasswordAPI: v.software === 'Pleroma',
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import { getSoapboxConfig } from'soapbox/actions/soapbox';
|
||||
import { isPrerendered } from 'soapbox/precheck';
|
||||
import { isURL } from 'soapbox/utils/auth';
|
||||
import { getBaseURL as getAccountBaseURL } from 'soapbox/utils/accounts';
|
||||
import { BACKEND_URL } from 'soapbox/build_config';
|
||||
|
||||
export const displayFqn = state => {
|
||||
@@ -27,3 +28,15 @@ export const isStandalone = state => {
|
||||
const instanceFetchFailed = state.getIn(['meta', 'instance_fetch_failed'], false);
|
||||
return isURL(BACKEND_URL) ? false : (!isPrerendered && instanceFetchFailed);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the baseURL of the instance.
|
||||
* @param {object} state
|
||||
* @returns {string} url
|
||||
*/
|
||||
export const getBaseURL = state => {
|
||||
const me = state.get('me');
|
||||
const account = state.getIn(['accounts', me]);
|
||||
|
||||
return isURL(BACKEND_URL) ? BACKEND_URL : getAccountBaseURL(account);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user