@umituz/react-native-auth 3.6.7 → 3.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-auth",
3
- "version": "3.6.7",
3
+ "version": "3.6.8",
4
4
  "description": "Authentication service for React Native apps - Secure, type-safe, and production-ready. Provider-agnostic design with dependency injection, configurable validation, and comprehensive error handling.",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -45,9 +45,10 @@ export const ChangePasswordScreen: React.FC<ChangePasswordScreenProps> = ({
45
45
  const [loading, setLoading] = useState(false);
46
46
  const [error, setError] = useState<string | null>(null);
47
47
 
48
- const [showCurrentPassword, setShowCurrentPassword] = useState(false);
49
- const [showNewPassword, setShowNewPassword] = useState(false);
50
- const [showConfirmPassword, setShowConfirmPassword] = useState(false);
48
+ /* Removed manual visibility states */
49
+ /* const [showCurrentPassword, setShowCurrentPassword] = useState(false); */
50
+ /* const [showNewPassword, setShowNewPassword] = useState(false); */
51
+ /* const [showConfirmPassword, setShowConfirmPassword] = useState(false); */
51
52
 
52
53
  // Validation state
53
54
  const isLengthValid = newPassword.length >= 8;
@@ -96,7 +97,6 @@ export const ChangePasswordScreen: React.FC<ChangePasswordScreenProps> = ({
96
97
  Alert.alert(t("common.success"), t("auth.passwordChange.success"), [
97
98
  { text: "OK", onPress: onSuccess }
98
99
  ]);
99
- // Iterate onSuccess callback as well in case alert is dismissed or handled differently in native
100
100
  if (onSuccess) onSuccess();
101
101
  } else {
102
102
  setError(updateResult.error?.message || t("auth.passwordChange.error"));
@@ -158,9 +158,8 @@ export const ChangePasswordScreen: React.FC<ChangePasswordScreenProps> = ({
158
158
  placeholder={t("auth.passwordChange.enterCurrentPassword")}
159
159
  value={currentPassword}
160
160
  onChangeText={setCurrentPassword}
161
- secureTextEntry={!showCurrentPassword}
162
- rightIcon={showCurrentPassword ? "eye-off" : "eye"}
163
- onRightIconPress={() => setShowCurrentPassword(!showCurrentPassword)}
161
+ secureTextEntry
162
+ showPasswordToggle
164
163
  variant="filled"
165
164
  />
166
165
 
@@ -170,9 +169,8 @@ export const ChangePasswordScreen: React.FC<ChangePasswordScreenProps> = ({
170
169
  placeholder={t("auth.passwordChange.enterNewPassword")}
171
170
  value={newPassword}
172
171
  onChangeText={setNewPassword}
173
- secureTextEntry={!showNewPassword}
174
- rightIcon={showNewPassword ? "eye-off" : "eye"}
175
- onRightIconPress={() => setShowNewPassword(!showNewPassword)}
172
+ secureTextEntry
173
+ showPasswordToggle
176
174
  variant="filled"
177
175
  />
178
176
 
@@ -182,9 +180,8 @@ export const ChangePasswordScreen: React.FC<ChangePasswordScreenProps> = ({
182
180
  placeholder={t("auth.passwordChange.enterConfirmPassword")}
183
181
  value={confirmPassword}
184
182
  onChangeText={setConfirmPassword}
185
- secureTextEntry={!showConfirmPassword}
186
- rightIcon={showConfirmPassword ? "eye-off" : "eye"}
187
- onRightIconPress={() => setShowConfirmPassword(!showConfirmPassword)}
183
+ secureTextEntry
184
+ showPasswordToggle
188
185
  variant="filled"
189
186
  />
190
187
 
@@ -199,7 +196,7 @@ export const ChangePasswordScreen: React.FC<ChangePasswordScreenProps> = ({
199
196
  <View style={styles.actions}>
200
197
  <AtomicButton
201
198
  title={t("common.cancel")}
202
- onPress={onCancel}
199
+ onPress={onCancel || (() => {})}
203
200
  variant="outline"
204
201
  style={{ flex: 1 }}
205
202
  />