diff options
author | 2021-06-05 16:28:45 +0530 | |
---|---|---|
committer | 2021-06-05 12:58:45 +0200 | |
commit | aa6689e6158efde28b68948cd8b67d55080158d2 (patch) | |
tree | 6e687fb7b5e2eb37c0027ba31d968b04632f5771 /src/components/auth/Login.js | |
parent | Reused commonly defined method for 'apiBase' (diff) | |
download | ferdium-app-aa6689e6158efde28b68948cd8b67d55080158d2.tar.gz ferdium-app-aa6689e6158efde28b68948cd8b67d55080158d2.tar.zst ferdium-app-aa6689e6158efde28b68948cd8b67d55080158d2.zip |
Removed hardcoded strings and reused constants defined in config.js (#1499)
Diffstat (limited to 'src/components/auth/Login.js')
-rw-r--r-- | src/components/auth/Login.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/auth/Login.js b/src/components/auth/Login.js index 23fdfcac7..52b09eab6 100644 --- a/src/components/auth/Login.js +++ b/src/components/auth/Login.js | |||
@@ -4,7 +4,8 @@ import PropTypes from 'prop-types'; | |||
4 | import { observer, inject } from 'mobx-react'; | 4 | import { observer, inject } from 'mobx-react'; |
5 | import { defineMessages, intlShape } from 'react-intl'; | 5 | import { defineMessages, intlShape } from 'react-intl'; |
6 | 6 | ||
7 | import { isDevMode, useLiveAPI } from '../../environment'; | 7 | import { LIVE_FRANZ_API } from '../../config'; |
8 | import { API_VERSION, isDevMode, useLiveAPI } from '../../environment'; | ||
8 | import Form from '../../lib/Form'; | 9 | import Form from '../../lib/Form'; |
9 | import { required, email } from '../../helpers/validation-helpers'; | 10 | import { required, email } from '../../helpers/validation-helpers'; |
10 | import serverlessLogin from '../../helpers/serverless-helpers'; | 11 | import serverlessLogin from '../../helpers/serverless-helpers'; |
@@ -164,12 +165,12 @@ export default @inject('actions') @observer class Login extends Component { | |||
164 | {error.code === 'invalid-credentials' && ( | 165 | {error.code === 'invalid-credentials' && ( |
165 | <> | 166 | <> |
166 | <p className="error-message center">{intl.formatMessage(messages.invalidCredentials)}</p> | 167 | <p className="error-message center">{intl.formatMessage(messages.invalidCredentials)}</p> |
167 | { window.ferdi.stores.settings.all.app.server !== 'https://api.franzinfra.com' && ( | 168 | { window.ferdi.stores.settings.all.app.server !== LIVE_FRANZ_API && ( |
168 | <p className="error-message center"> | 169 | <p className="error-message center"> |
169 | {intl.formatMessage(messages.customServerQuestion)} | 170 | {intl.formatMessage(messages.customServerQuestion)} |
170 | {' '} | 171 | {' '} |
171 | <Link | 172 | <Link |
172 | to={`${window.ferdi.stores.settings.all.app.server.replace('v1', '')}/import`} | 173 | to={`${window.ferdi.stores.settings.all.app.server.replace(API_VERSION, '')}/import`} |
173 | target="_blank" | 174 | target="_blank" |
174 | style={{ cursor: 'pointer', textDecoration: 'underline' }} | 175 | style={{ cursor: 'pointer', textDecoration: 'underline' }} |
175 | > | 176 | > |