email registration updated

This commit is contained in:
Stephan D
2026-02-17 10:20:39 +01:00
parent 11d4b9a608
commit 9bdb667b08
4 changed files with 15 additions and 20 deletions

View File

@@ -338,10 +338,8 @@ func (a *AccountAPI) openOrgLedgerAccount(ctx context.Context, org *model.Organi
return merrors.Internal("chain gateway default asset is not configured") return merrors.Internal("chain gateway default asset is not configured")
} }
currency := strings.ToUpper(strings.TrimSpace(a.chainAsset.TokenSymbol)) // TODO: remove hardcode
if currency == "" { currency := "RUB"
return merrors.Internal("chain gateway default asset token symbol is not configured")
}
var describable *describablev1.Describable var describable *describablev1.Describable
name := strings.TrimSpace(sr.LedgerWallet.Name) name := strings.TrimSpace(sr.LedgerWallet.Name)

View File

@@ -12,21 +12,18 @@ class TwoFactorCodeInput extends StatelessWidget {
Widget build(BuildContext context) => Center( Widget build(BuildContext context) => Center(
child: ConstrainedBox( child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 300), constraints: const BoxConstraints(maxWidth: 300),
child: PinCodeTextField( child: MaterialPinField(
length: 6, length: 6,
appContext: context,
autoFocus: true, autoFocus: true,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
animationType: AnimationType.fade, theme: MaterialPinTheme(
cursorColor: Theme.of(context).colorScheme.primary, entryAnimation: MaterialPinAnimation.fade,
pinTheme: PinTheme( shape: MaterialPinShape.outlined,
shape: PinCodeFieldShape.box,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
fieldHeight: 48, cellSize: Size(40, 48),
fieldWidth: 40, borderColor: Theme.of(context).colorScheme.primaryContainer,
inactiveColor: Theme.of(context).colorScheme.primaryContainer, focusedBorderColor: Theme.of(context).colorScheme.primary,
activeColor: Theme.of(context).colorScheme.primary, cursorColor: Theme.of(context).colorScheme.primary,
selectedColor: Theme.of(context).colorScheme.primary,
), ),
onCompleted: onCompleted, onCompleted: onCompleted,
onChanged: (_) {}, onChanged: (_) {},

View File

@@ -1,16 +1,16 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:email_validator/email_validator.dart';
import 'package:pweb/generated/i18n/app_localizations.dart'; import 'package:pweb/generated/i18n/app_localizations.dart';
//TODO check with /widgets/username.dart //TODO: check with /widgets/username.dart
class EmailField extends StatelessWidget { class EmailField extends StatelessWidget {
final TextEditingController controller; final TextEditingController controller;
const EmailField({super.key, required this.controller}); const EmailField({super.key, required this.controller});
static final _emailRegex = RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -22,7 +22,7 @@ class EmailField extends StatelessWidget {
hintText: AppLocalizations.of(context)!.usernameHint, hintText: AppLocalizations.of(context)!.usernameHint,
), ),
validator: (value) { validator: (value) {
if (value == null || !_emailRegex.hasMatch(value)) { if (value == null || !EmailValidator.validate(value)) {
return AppLocalizations.of(context)!.usernameErrorInvalid; return AppLocalizations.of(context)!.usernameErrorInvalid;
} }
return null; return null;

View File

@@ -63,7 +63,7 @@ dependencies:
markdown_widget: ^2.3.2+6 markdown_widget: ^2.3.2+6
timeago: ^3.7.0 timeago: ^3.7.0
flutter_settings_ui: ^3.0.1 flutter_settings_ui: ^3.0.1
pin_code_fields: ^8.0.1 pin_code_fields: ^9.0.0
fl_chart: ^1.0.0 fl_chart: ^1.0.0
syncfusion_flutter_charts: ^32.1.19 syncfusion_flutter_charts: ^32.1.19
flutter_multi_formatter: ^2.13.7 flutter_multi_formatter: ^2.13.7