Skip to content

Commit

Permalink
Merge pull request #499 from alexstotsky/pswd-by-default
Browse files Browse the repository at this point in the history
(improvement) Persist password protection for the hosted framework mode
  • Loading branch information
prdn authored Apr 8, 2022
2 parents 61dd304 + dd5011d commit f5ab417
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/Auth/PasswordRecovery/PasswordRecovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PasswordRecovery extends PureComponent {
password: '',
passwordRepeat: '',
isBeingValidated: false,
isPasswordProtected: false,
isPasswordProtected: config.hostedFrameworkMode,
isPersisted,
passwordError: '',
passwordRepeatError: '',
Expand Down Expand Up @@ -145,10 +145,10 @@ class PasswordRecovery extends PureComponent {
} = this.state

const icon = config.showFrameworkMode ? <Icon.SIGN_UP /> : <Icon.SIGN_IN />
const showPasswordProtection = config.showFrameworkMode && !config.hostedFrameworkMode
const isPasswordRecoveryDisabled = !apiKey || !apiSecret
|| (config.showFrameworkMode && isPasswordProtected
&& (!password || !passwordRepeat || passwordError || passwordRepeatError))

const classes = classNames('bitfinex-auth', 'bitfinex-auth-sign-up', {
'bitfinex-auth-sign-up--framework': config.showFrameworkMode,
})
Expand Down Expand Up @@ -202,7 +202,7 @@ class PasswordRecovery extends PureComponent {
>
{t('auth.rememberMe')}
</Checkbox>
{config.showFrameworkMode && (
{showPasswordProtection && (
<Checkbox
className='bitfinex-auth-remember-me'
name='isPasswordProtected'
Expand Down
6 changes: 3 additions & 3 deletions src/components/Auth/SignUp/SignUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SignUp extends PureComponent {
password: '',
passwordRepeat: '',
isBeingValidated: false,
isPasswordProtected: false,
isPasswordProtected: config.hostedFrameworkMode,
isPersisted,
passwordError: '',
passwordRepeatError: '',
Expand Down Expand Up @@ -161,10 +161,10 @@ class SignUp extends PureComponent {

const title = config.showFrameworkMode ? t('auth.signUp') : t('auth.title')
const icon = config.showFrameworkMode ? <Icon.SIGN_UP /> : <Icon.SIGN_IN />
const showPasswordProtection = config.showFrameworkMode && !config.hostedFrameworkMode
const isSignUpDisabled = !apiKey || !apiSecret
|| (config.showFrameworkMode && isPasswordProtected
&& (!password || !passwordRepeat || passwordError || passwordRepeatError))

const classes = classNames('bitfinex-auth', 'bitfinex-auth-sign-up', {
'bitfinex-auth-sign-up--framework': config.showFrameworkMode,
})
Expand Down Expand Up @@ -232,7 +232,7 @@ class SignUp extends PureComponent {
>
{t('auth.rememberMe')}
</Checkbox>
{config.showFrameworkMode && (
{showPasswordProtection && (
<Checkbox
className='bitfinex-auth-remember-me'
name='isPasswordProtected'
Expand Down
4 changes: 4 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const environments = {
localExport: true,
showAuthPage: true,
showFrameworkMode: true,
hostedFrameworkMode: false,
},
testing: {
API_URL: 'https://bfx-report-ui.staging.bitfinex.com/api',
Expand All @@ -20,6 +21,7 @@ const environments = {
localExport: false,
showAuthPage: true,
showFrameworkMode: false,
hostedFrameworkMode: false,
},
staging: {
API_URL: 'https://bfx-report-ui.staging.bitfinex.com/api',
Expand All @@ -29,6 +31,7 @@ const environments = {
localExport: false,
showAuthPage: true,
showFrameworkMode: false,
hostedFrameworkMode: false,
},
production: {
API_URL: 'https://report.bitfinex.com/api',
Expand All @@ -38,6 +41,7 @@ const environments = {
localExport: false,
showAuthPage: false,
showFrameworkMode: false,
hostedFrameworkMode: false,
},
}

Expand Down

0 comments on commit f5ab417

Please sign in to comment.