Skip to content

Commit fae1ff6

Browse files
committed
fix: fix rebase discrepancies in sign up [#246]
1 parent 1176986 commit fae1ff6

File tree

3 files changed

+12
-26
lines changed

3 files changed

+12
-26
lines changed

packages/clerk_auth/lib/src/models/enums.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ enum UserAttribute {
5656
/// password
5757
password,
5858

59+
/// password confirmation
60+
passwordConfirmation,
61+
5962
/// web3 wallet
6063
web3Wallet,
6164

packages/clerk_flutter/lib/src/utils/localization_extensions.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ extension ClerkUserAttributeLocalization on clerk.UserAttribute {
130130
clerk.UserAttribute.firstName => l10ns.firstName,
131131
clerk.UserAttribute.lastName => l10ns.lastName,
132132
clerk.UserAttribute.password => l10ns.password,
133+
clerk.UserAttribute.passwordConfirmation => l10ns.passwordConfirmation,
133134
clerk.UserAttribute.web3Wallet => l10ns.web3Wallet,
134135
clerk.UserAttribute.authenticatorApp => l10ns.authenticatorApp,
135136
clerk.UserAttribute.backupCode => l10ns.backupCode,

packages/clerk_flutter/lib/src/widgets/authentication/clerk_sign_up_panel.dart

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ class _ClerkSignUpPanelState extends State<ClerkSignUpPanel>
5151
static final _phoneNumberRE = RegExp(r'[^0-9+]');
5252
final Map<clerk.UserAttribute, String?> _values = {};
5353
_SignUpPanelState _state = _SignUpPanelState.input;
54-
String _passwordConfirmation = '';
55-
bool _isObscured = true;
5654
bool _needsLegalAcceptance = true;
5755
bool _hasLegalAcceptance = false;
5856
bool _highlightMissing = false;
@@ -114,8 +112,10 @@ class _ClerkSignUpPanelState extends State<ClerkSignUpPanel>
114112
return;
115113
}
116114

117-
final conf = _passwordConfirmation.trim();
118-
if (authState.checkPassword(password, conf, context) case String error) {
115+
final passwordConfirmation =
116+
_valueOrNull(clerk.UserAttribute.passwordConfirmation);
117+
if (authState.checkPassword(password, passwordConfirmation, context)
118+
case String error) {
119119
authState.addError(
120120
clerk.AuthError(
121121
code: clerk.AuthErrorCode.invalidPassword,
@@ -153,7 +153,7 @@ class _ClerkSignUpPanelState extends State<ClerkSignUpPanel>
153153
emailAddress: emailAddress,
154154
phoneNumber: phoneNumber,
155155
password: password,
156-
passwordConfirmation: _passwordConfirmation.orNullIfEmpty,
156+
passwordConfirmation: passwordConfirmation,
157157
legalAccepted: _needsLegalAcceptance ? _hasLegalAcceptance : null,
158158
);
159159
},
@@ -276,25 +276,6 @@ class _ClerkSignUpPanelState extends State<ClerkSignUpPanel>
276276
(_needsLegalAcceptance && _hasLegalAcceptance == false),
277277
child: ClerkContinueButton(onPressed: () => _continue(attributes)),
278278
),
279-
if (_needsLegalAcceptance) //
280-
Closeable(
281-
closed: _hasLegalAcceptance,
282-
child: Padding(
283-
padding: topPadding4,
284-
child: Column(
285-
crossAxisAlignment: CrossAxisAlignment.stretch,
286-
children: [
287-
horizontalMargin16,
288-
Expanded(child: Center(child: Text(l10ns.cont))),
289-
const SizedBox(
290-
width: 16,
291-
child: Icon(Icons.arrow_right_sharp),
292-
),
293-
],
294-
),
295-
),
296-
),
297-
),
298279
if (_needsLegalAcceptance) //
299280
Row(
300281
mainAxisAlignment: MainAxisAlignment.start,
@@ -412,14 +393,15 @@ class _LegalAcceptanceConfirmation extends StatelessWidget {
412393
if (url case String url when url.isNotEmpty) {
413394
final segments = text.split(target);
414395
final spans = [TextSpan(text: segments.first)];
396+
final recognizer = TapGestureRecognizer()
397+
..onTap = () => launchUrlString(url);
415398

416399
for (final segmentText in segments.skip(1)) {
417400
spans.add(
418401
TextSpan(
419402
text: target,
420403
style: const TextStyle(color: ClerkColors.azure),
421-
recognizer: TapGestureRecognizer()
422-
..onTap = () => launchUrlString(url),
404+
recognizer: recognizer,
423405
),
424406
);
425407
if (segmentText.isNotEmpty) {

0 commit comments

Comments
 (0)