feat: update default authn settings (#1160)

At present, Authn MFE doesn't work out of the box with
devstack settings. These changes allow authn to work with
default devstack settings.
This commit is contained in:
Zainab Amir
2024-02-13 00:54:26 -08:00
committed by GitHub
parent a6e96f5ed1
commit 02bd8abcd1
2 changed files with 12 additions and 9 deletions

View File

@@ -19,6 +19,9 @@ REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
SEGMENT_KEY=''
SITE_NAME='Your Platform Name Here'
INFO_EMAIL='info@example.com'
# ***** Features *****
ENABLE_DYNAMIC_REGISTRATION_FIELDS='true'
ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN='true'
# ***** Cookies *****
SESSION_COOKIE_DOMAIN='localhost'
USER_INFO_COOKIE_NAME='edx-user-info'

View File

@@ -1,4 +1,4 @@
import { getConfig, snakeCaseObject } from '@edx/frontend-platform';
import { snakeCaseObject } from '@edx/frontend-platform';
import { LETTER_REGEX, NUMBER_REGEX } from '../../data/constants';
import messages from '../messages';
@@ -44,15 +44,15 @@ export const isFormValid = (
}
});
if (getConfig().SHOW_CONFIGURABLE_EDX_FIELDS) {
if (!configurableFormFields?.country?.displayValue) {
fieldErrors.country = formatMessage(messages['empty.country.field.error']);
isValid = false;
} else if (!configurableFormFields?.country?.countryCode) {
fieldErrors.country = formatMessage(messages['invalid.country.field.error']);
isValid = false;
}
// Don't validate when country field is optional or hidden and not present on registration form
if (configurableFormFields?.country && !configurableFormFields.country?.displayValue) {
fieldErrors.country = formatMessage(messages['empty.country.field.error']);
isValid = false;
} else if (configurableFormFields?.country && !configurableFormFields.country?.countryCode) {
fieldErrors.country = formatMessage(messages['invalid.country.field.error']);
isValid = false;
}
Object.keys(fieldDescriptions).forEach(key => {
if (key === 'country' && !configurableFormFields.country.displayValue) {
fieldErrors[key] = formatMessage(messages['empty.country.field.error']);