fix: if a new user gets to account create page without target language in local storage or from course, direct them back to language selection (#4422)

This commit is contained in:
ggurdin 2025-10-16 09:27:44 -04:00 committed by GitHub
parent 541423819d
commit 16ddaea9d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -165,8 +165,17 @@ class CreatePangeaAccountPageState extends State<CreatePangeaAccountPage> {
}
try {
final targetLangCode = await _targetLangCode;
final baseLangCode = await _baseLangCode;
final targetLangCode = await _targetLangCode;
// User's L2 is not set and they niether have a target language in their
// local storage nor can they get it from a course they plan to join.
// Redirect back to language selection.
// This can happen if a user creates a new account via login => SSO
if (targetLangCode == null) {
context.go('/registration');
}
final updateFuture = [
_setAvatar(),
MatrixState.pangeaController.userController.updateProfile(