@umituz/react-native-auth 3.4.31 → 3.4.32
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 +1 -1
- package/src/presentation/README.md +2 -2
- package/src/presentation/components/LoginForm.md +158 -267
- package/src/presentation/components/PasswordIndicators.md +199 -410
- package/src/presentation/components/ProfileComponents.md +254 -111
- package/src/presentation/components/SocialLoginButtons.md +295 -258
- package/src/presentation/hooks/useAccountManagement.md +191 -185
- package/src/presentation/hooks/useAuthBottomSheet.md +74 -77
- package/src/presentation/hooks/useSocialLogin.md +90 -145
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# useAccountManagement
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hook for account management operations (logout, delete account).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- Reauthentication callback
|
|
10
|
-
- Loading state
|
|
7
|
+
- Sign out functionality
|
|
8
|
+
- Account deletion with reauthentication
|
|
9
|
+
- Reauthentication callback support
|
|
10
|
+
- Loading state management
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Usage
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import { useAccountManagement } from '@umituz/react-native-auth';
|
|
@@ -17,58 +17,21 @@ import { useAccountManagement } from '@umituz/react-native-auth';
|
|
|
17
17
|
function AccountSettings() {
|
|
18
18
|
const { logout, deleteAccount, isLoading, isDeletingAccount } = useAccountManagement({
|
|
19
19
|
onReauthRequired: async () => {
|
|
20
|
-
// Google/Apple
|
|
20
|
+
// Show Google/Apple sign-in UI
|
|
21
21
|
const result = await reauthenticateWithGoogle();
|
|
22
22
|
return result.success;
|
|
23
23
|
},
|
|
24
24
|
onPasswordRequired: async () => {
|
|
25
|
-
//
|
|
25
|
+
// Show password prompt
|
|
26
26
|
const password = await showPasswordPrompt();
|
|
27
27
|
return password;
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
const handleLogout = async () => {
|
|
32
|
-
Alert.alert(
|
|
33
|
-
'Çıkış Yap',
|
|
34
|
-
'Çıkış yapmak istediğinizden emin misiniz?',
|
|
35
|
-
[
|
|
36
|
-
{ text: 'İptal', style: 'cancel' },
|
|
37
|
-
{
|
|
38
|
-
text: 'Çıkış',
|
|
39
|
-
onPress: logout,
|
|
40
|
-
},
|
|
41
|
-
]
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const handleDeleteAccount = async () => {
|
|
46
|
-
Alert.alert(
|
|
47
|
-
'Hesabı Sil',
|
|
48
|
-
'Bu işlem geri alınamaz. Hesabınızı silmek istediğinizden emin misiniz?',
|
|
49
|
-
[
|
|
50
|
-
{ text: 'İptal', style: 'cancel' },
|
|
51
|
-
{
|
|
52
|
-
text: 'Sil',
|
|
53
|
-
style: 'destructive',
|
|
54
|
-
onPress: deleteAccount,
|
|
55
|
-
},
|
|
56
|
-
]
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
31
|
return (
|
|
61
32
|
<View>
|
|
62
|
-
<Button onPress={
|
|
63
|
-
|
|
64
|
-
</Button>
|
|
65
|
-
<Button
|
|
66
|
-
onPress={handleDeleteAccount}
|
|
67
|
-
disabled={isDeletingAccount}
|
|
68
|
-
style={{ backgroundColor: 'red' }}
|
|
69
|
-
>
|
|
70
|
-
{isDeletingAccount ? 'Siliniyor...' : 'Hesabı Sil'}
|
|
71
|
-
</Button>
|
|
33
|
+
<Button onPress={logout}>Sign Out</Button>
|
|
34
|
+
<Button onPress={deleteAccount}>Delete Account</Button>
|
|
72
35
|
</View>
|
|
73
36
|
);
|
|
74
37
|
}
|
|
@@ -78,122 +41,43 @@ function AccountSettings() {
|
|
|
78
41
|
|
|
79
42
|
### Parameters
|
|
80
43
|
|
|
81
|
-
| Param |
|
|
82
|
-
|
|
83
|
-
| `onReauthRequired` | `() => Promise<boolean>` | No | Google/Apple
|
|
84
|
-
| `onPasswordRequired` | `() => Promise<string \| null>` | No |
|
|
44
|
+
| Param | Type | Required | Description |
|
|
45
|
+
|-------|------|----------|-------------|
|
|
46
|
+
| `onReauthRequired` | `() => Promise<boolean>` | No | Callback for Google/Apple reauthentication |
|
|
47
|
+
| `onPasswordRequired` | `() => Promise<string \| null>` | No | Callback for password reauthentication |
|
|
85
48
|
|
|
86
49
|
### Return Value
|
|
87
50
|
|
|
88
|
-
| Prop |
|
|
89
|
-
|
|
90
|
-
| `logout` | `() => Promise<void>` |
|
|
91
|
-
| `deleteAccount` | `() => Promise<void>` |
|
|
92
|
-
| `isLoading` | `boolean` |
|
|
93
|
-
| `isDeletingAccount` | `boolean` |
|
|
94
|
-
|
|
95
|
-
## Reauthentication
|
|
96
|
-
|
|
97
|
-
Hesap silme işlemi hassas bir işlem olduğu için Firebase, kullanıcının son zamanlarda giriş yapmasını gerektirir. Bu hook size reauthentication için callback'ler sağlar.
|
|
51
|
+
| Prop | Type | Description |
|
|
52
|
+
|------|------|-------------|
|
|
53
|
+
| `logout` | `() => Promise<void>` | Sign out function |
|
|
54
|
+
| `deleteAccount` | `() => Promise<void>` | Delete account function |
|
|
55
|
+
| `isLoading` | `boolean` | General loading state |
|
|
56
|
+
| `isDeletingAccount` | `boolean` | Account deletion loading state |
|
|
98
57
|
|
|
99
|
-
|
|
58
|
+
## Examples
|
|
100
59
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
```typescript
|
|
104
|
-
const { deleteAccount } = useAccountManagement({
|
|
105
|
-
onReauthRequired: async () => {
|
|
106
|
-
try {
|
|
107
|
-
// Google ile yeniden authentication
|
|
108
|
-
const result = await signInWithGooglePopup();
|
|
109
|
-
|
|
110
|
-
if (result.user) {
|
|
111
|
-
Alert.alert('Başarılı', 'Lütfen hesap silme işlemine devam edin');
|
|
112
|
-
return true;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return false;
|
|
116
|
-
} catch (error) {
|
|
117
|
-
Alert.alert('Hata', 'Reauthentication başarısız');
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### onPasswordRequired
|
|
125
|
-
|
|
126
|
-
Email/password ile giriş yapmış kullanıcılar için:
|
|
127
|
-
|
|
128
|
-
```typescript
|
|
129
|
-
const { deleteAccount } = useAccountManagement({
|
|
130
|
-
onPasswordRequired: async () => {
|
|
131
|
-
return new Promise((resolve) => {
|
|
132
|
-
// Şifre prompt göster
|
|
133
|
-
Alert.prompt(
|
|
134
|
-
'Şifre Girin',
|
|
135
|
-
'Hesabınızı silmek için şifrenizi girin',
|
|
136
|
-
[
|
|
137
|
-
{
|
|
138
|
-
text: 'İptal',
|
|
139
|
-
onPress: () => resolve(null),
|
|
140
|
-
style: 'cancel',
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
text: 'Tamam',
|
|
144
|
-
onPress: (password) => resolve(password || null),
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
'secure-text'
|
|
148
|
-
);
|
|
149
|
-
});
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Örnekler
|
|
155
|
-
|
|
156
|
-
### Basit Hesap Ayarları Ekranı
|
|
60
|
+
### Simple Account Settings
|
|
157
61
|
|
|
158
62
|
```typescript
|
|
159
63
|
function AccountSettingsScreen() {
|
|
160
64
|
const { logout, deleteAccount, isDeletingAccount } = useAccountManagement();
|
|
161
|
-
const navigation = useNavigation();
|
|
162
|
-
|
|
163
|
-
const handleLogout = async () => {
|
|
164
|
-
try {
|
|
165
|
-
await logout();
|
|
166
|
-
navigation.replace('Login');
|
|
167
|
-
} catch (error) {
|
|
168
|
-
Alert.alert('Hata', 'Çıkış yapılamadı');
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const handleDeleteAccount = async () => {
|
|
173
|
-
try {
|
|
174
|
-
await deleteAccount();
|
|
175
|
-
navigation.replace('Login');
|
|
176
|
-
Alert.alert('Başarılı', 'Hesabınız silindi');
|
|
177
|
-
} catch (error) {
|
|
178
|
-
Alert.alert('Hata', 'Hesap silinemedi');
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
65
|
|
|
182
66
|
return (
|
|
183
67
|
<ScrollView style={styles.container}>
|
|
184
|
-
<Section title="
|
|
68
|
+
<Section title="Session">
|
|
185
69
|
<MenuItem
|
|
186
|
-
title="
|
|
70
|
+
title="Sign Out"
|
|
187
71
|
icon="log-out"
|
|
188
|
-
onPress={
|
|
72
|
+
onPress={logout}
|
|
189
73
|
/>
|
|
190
74
|
</Section>
|
|
191
75
|
|
|
192
|
-
<Section title="
|
|
76
|
+
<Section title="Danger Zone">
|
|
193
77
|
<MenuItem
|
|
194
|
-
title="
|
|
78
|
+
title="Delete Account"
|
|
195
79
|
icon="trash"
|
|
196
|
-
onPress={
|
|
80
|
+
onPress={deleteAccount}
|
|
197
81
|
destructive
|
|
198
82
|
disabled={isDeletingAccount}
|
|
199
83
|
/>
|
|
@@ -204,12 +88,59 @@ function AccountSettingsScreen() {
|
|
|
204
88
|
}
|
|
205
89
|
```
|
|
206
90
|
|
|
91
|
+
### With Reauthentication
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
function AccountSettingsScreen() {
|
|
95
|
+
const { logout, deleteAccount } = useAccountManagement({
|
|
96
|
+
onReauthRequired: async () => {
|
|
97
|
+
try {
|
|
98
|
+
// Reauthenticate with Google
|
|
99
|
+
const result = await signInWithGooglePopup();
|
|
100
|
+
|
|
101
|
+
if (result.user) {
|
|
102
|
+
Alert.alert('Success', 'Please continue with account deletion');
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return false;
|
|
107
|
+
} catch (error) {
|
|
108
|
+
Alert.alert('Error', 'Reauthentication failed');
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
onPasswordRequired: async () => {
|
|
113
|
+
return new Promise((resolve) => {
|
|
114
|
+
// Show password prompt
|
|
115
|
+
Alert.prompt(
|
|
116
|
+
'Enter Password',
|
|
117
|
+
'Please enter your password to delete your account',
|
|
118
|
+
[
|
|
119
|
+
{
|
|
120
|
+
text: 'Cancel',
|
|
121
|
+
onPress: () => resolve(null),
|
|
122
|
+
style: 'cancel',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
text: 'OK',
|
|
126
|
+
onPress: (password) => resolve(password || null),
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
'secure-text'
|
|
130
|
+
);
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// ...
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
207
139
|
### Custom Reauthentication UI
|
|
208
140
|
|
|
209
141
|
```typescript
|
|
210
142
|
function DeleteAccountScreen() {
|
|
211
143
|
const [showReauth, setShowReauth] = useState(false);
|
|
212
|
-
const [reauthMethod, setReauthMethod] = useState<'password' | 'google' | 'apple'>('password');
|
|
213
144
|
|
|
214
145
|
const { deleteAccount, isDeletingAccount } = useAccountManagement({
|
|
215
146
|
onReauthRequired: async () => {
|
|
@@ -221,8 +152,7 @@ function DeleteAccountScreen() {
|
|
|
221
152
|
resolve(success);
|
|
222
153
|
};
|
|
223
154
|
|
|
224
|
-
|
|
225
|
-
showCustomReauthUI(reauthMethod, handleResult);
|
|
155
|
+
showCustomReauthUI(handleResult);
|
|
226
156
|
});
|
|
227
157
|
},
|
|
228
158
|
onPasswordRequired: async () => {
|
|
@@ -240,23 +170,22 @@ function DeleteAccountScreen() {
|
|
|
240
170
|
const handleDelete = async () => {
|
|
241
171
|
try {
|
|
242
172
|
await deleteAccount();
|
|
243
|
-
Alert.alert('
|
|
173
|
+
Alert.alert('Success', 'Account deleted');
|
|
244
174
|
} catch (error) {
|
|
245
|
-
Alert.alert('
|
|
175
|
+
Alert.alert('Error', error.message);
|
|
246
176
|
}
|
|
247
177
|
};
|
|
248
178
|
|
|
249
179
|
return (
|
|
250
180
|
<View>
|
|
251
181
|
<Button onPress={handleDelete} disabled={isDeletingAccount}>
|
|
252
|
-
|
|
182
|
+
Delete Account
|
|
253
183
|
</Button>
|
|
254
184
|
|
|
255
185
|
{showReauth && (
|
|
256
186
|
<ReauthenticationModal
|
|
257
|
-
method={reauthMethod}
|
|
258
187
|
onComplete={() => {
|
|
259
|
-
// Reauthentication
|
|
188
|
+
// Reauthentication successful, deleteAccount continues
|
|
260
189
|
}}
|
|
261
190
|
/>
|
|
262
191
|
)}
|
|
@@ -265,7 +194,7 @@ function DeleteAccountScreen() {
|
|
|
265
194
|
}
|
|
266
195
|
```
|
|
267
196
|
|
|
268
|
-
###
|
|
197
|
+
### Delete Account Confirmation
|
|
269
198
|
|
|
270
199
|
```typescript
|
|
271
200
|
function DeleteAccountConfirmation() {
|
|
@@ -274,17 +203,17 @@ function DeleteAccountConfirmation() {
|
|
|
274
203
|
|
|
275
204
|
const handleDelete = async () => {
|
|
276
205
|
if (!agreed) {
|
|
277
|
-
Alert.alert('
|
|
206
|
+
Alert.alert('Warning', 'Please accept the terms');
|
|
278
207
|
return;
|
|
279
208
|
}
|
|
280
209
|
|
|
281
210
|
Alert.alert(
|
|
282
|
-
'
|
|
283
|
-
'
|
|
211
|
+
'Delete Account',
|
|
212
|
+
'This action cannot be undone. Are you sure?',
|
|
284
213
|
[
|
|
285
|
-
{ text: '
|
|
214
|
+
{ text: 'Cancel', style: 'cancel' },
|
|
286
215
|
{
|
|
287
|
-
text: '
|
|
216
|
+
text: 'Delete',
|
|
288
217
|
style: 'destructive',
|
|
289
218
|
onPress: deleteAccount,
|
|
290
219
|
},
|
|
@@ -295,16 +224,16 @@ function DeleteAccountConfirmation() {
|
|
|
295
224
|
return (
|
|
296
225
|
<View>
|
|
297
226
|
<Text style={styles.warning}>
|
|
298
|
-
|
|
227
|
+
By deleting your account:
|
|
299
228
|
</Text>
|
|
300
|
-
<Text>•
|
|
301
|
-
<Text>•
|
|
302
|
-
<Text>•
|
|
229
|
+
<Text>• All your data will be permanently deleted</Text>
|
|
230
|
+
<Text>• This action cannot be undone</Text>
|
|
231
|
+
<Text>• You won't be able to sign in with the same account</Text>
|
|
303
232
|
|
|
304
233
|
<CheckBox
|
|
305
234
|
value={agreed}
|
|
306
235
|
onValueChange={setAgreed}
|
|
307
|
-
label="
|
|
236
|
+
label="I accept the account deletion terms"
|
|
308
237
|
/>
|
|
309
238
|
|
|
310
239
|
<Button
|
|
@@ -312,27 +241,58 @@ function DeleteAccountConfirmation() {
|
|
|
312
241
|
disabled={!agreed || isDeletingAccount}
|
|
313
242
|
style={{ backgroundColor: 'red' }}
|
|
314
243
|
>
|
|
315
|
-
{isDeletingAccount ? '
|
|
244
|
+
{isDeletingAccount ? 'Deleting...' : 'Permanently Delete Account'}
|
|
316
245
|
</Button>
|
|
317
246
|
</View>
|
|
318
247
|
);
|
|
319
248
|
}
|
|
320
249
|
```
|
|
321
250
|
|
|
322
|
-
|
|
251
|
+
### Anonymous User Handling
|
|
323
252
|
|
|
324
253
|
```typescript
|
|
325
|
-
function
|
|
254
|
+
function AccountActionsAnonymous() {
|
|
255
|
+
const { isAnonymous } = useAuth();
|
|
256
|
+
|
|
257
|
+
if (isAnonymous) {
|
|
258
|
+
return (
|
|
259
|
+
<Button onPress={() => navigation.navigate('Register')}>
|
|
260
|
+
Create Account
|
|
261
|
+
</Button>
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const config = {
|
|
266
|
+
logoutText: 'Sign Out',
|
|
267
|
+
deleteAccountText: 'Delete Account',
|
|
268
|
+
logoutConfirmTitle: 'Sign Out',
|
|
269
|
+
logoutConfirmMessage: 'Are you sure you want to sign out?',
|
|
270
|
+
deleteConfirmTitle: 'Delete Account',
|
|
271
|
+
deleteConfirmMessage: 'Are you sure you want to delete your account?',
|
|
272
|
+
onLogout: logout,
|
|
273
|
+
onDeleteAccount: deleteAccount,
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
return <AccountActions config={config} />;
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Error Handling
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
function AccountSettingsWithErrorHandling() {
|
|
326
284
|
const { logout, deleteAccount } = useAccountManagement();
|
|
285
|
+
const navigation = useNavigation();
|
|
327
286
|
|
|
328
287
|
const handleLogout = async () => {
|
|
329
288
|
try {
|
|
330
289
|
await logout();
|
|
290
|
+
navigation.replace('Login');
|
|
331
291
|
} catch (error) {
|
|
332
292
|
if (error.code === 'auth/network-request-failed') {
|
|
333
|
-
Alert.alert('
|
|
293
|
+
Alert.alert('Connection Error', 'Check your internet connection');
|
|
334
294
|
} else {
|
|
335
|
-
Alert.alert('
|
|
295
|
+
Alert.alert('Error', 'Failed to sign out');
|
|
336
296
|
}
|
|
337
297
|
}
|
|
338
298
|
};
|
|
@@ -340,41 +300,87 @@ function AccountSettings() {
|
|
|
340
300
|
const handleDeleteAccount = async () => {
|
|
341
301
|
try {
|
|
342
302
|
await deleteAccount();
|
|
303
|
+
Alert.alert('Success', 'Account deleted');
|
|
304
|
+
navigation.replace('Login');
|
|
343
305
|
} catch (error) {
|
|
344
306
|
if (error.code === 'auth/requires-recent-login') {
|
|
345
307
|
Alert.alert(
|
|
346
|
-
'
|
|
347
|
-
'
|
|
308
|
+
'Authentication Required',
|
|
309
|
+
'Please sign in again to delete your account'
|
|
348
310
|
);
|
|
349
311
|
} else if (error.code === 'auth/too-many-requests') {
|
|
350
312
|
Alert.alert(
|
|
351
|
-
'
|
|
352
|
-
'
|
|
313
|
+
'Too Many Attempts',
|
|
314
|
+
'Too many failed attempts. Please try again later'
|
|
353
315
|
);
|
|
354
316
|
} else {
|
|
355
|
-
Alert.alert('
|
|
317
|
+
Alert.alert('Error', 'Failed to delete account');
|
|
356
318
|
}
|
|
357
319
|
}
|
|
358
320
|
};
|
|
359
321
|
|
|
360
322
|
return (
|
|
361
323
|
<View>
|
|
362
|
-
<Button onPress={handleLogout}
|
|
363
|
-
<Button onPress={handleDeleteAccount}>
|
|
324
|
+
<Button onPress={handleLogout}>Sign Out</Button>
|
|
325
|
+
<Button onPress={handleDeleteAccount}>Delete Account</Button>
|
|
364
326
|
</View>
|
|
365
327
|
);
|
|
366
328
|
}
|
|
367
329
|
```
|
|
368
330
|
|
|
369
|
-
##
|
|
331
|
+
## Important Notes
|
|
332
|
+
|
|
333
|
+
1. **Reauthentication Required**: Firebase requires recent sign-in for account deletion
|
|
334
|
+
2. **Anonymous Users**: Anonymous accounts cannot be deleted
|
|
335
|
+
3. **Irreversible**: Account deletion is permanent
|
|
336
|
+
4. **Callbacks**: If `onReauthRequired` and `onPasswordRequired` are not provided, errors will be thrown
|
|
337
|
+
|
|
338
|
+
## Reauthentication
|
|
339
|
+
|
|
340
|
+
Account deletion is a sensitive operation, so Firebase requires the user to have signed in recently. This hook provides reauthentication callbacks:
|
|
341
|
+
|
|
342
|
+
### onReauthRequired
|
|
343
|
+
|
|
344
|
+
For Google or Apple sign-in users:
|
|
345
|
+
|
|
346
|
+
```typescript
|
|
347
|
+
const { deleteAccount } = useAccountManagement({
|
|
348
|
+
onReauthRequired: async () => {
|
|
349
|
+
try {
|
|
350
|
+
// Reauthenticate with Google
|
|
351
|
+
const result = await signInWithGooglePopup();
|
|
352
|
+
return result.user ? true : false;
|
|
353
|
+
} catch (error) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### onPasswordRequired
|
|
361
|
+
|
|
362
|
+
For email/password users:
|
|
370
363
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
364
|
+
```typescript
|
|
365
|
+
const { deleteAccount } = useAccountManagement({
|
|
366
|
+
onPasswordRequired: async () => {
|
|
367
|
+
return new Promise((resolve) => {
|
|
368
|
+
Alert.prompt(
|
|
369
|
+
'Enter Password',
|
|
370
|
+
'Please enter your password',
|
|
371
|
+
[
|
|
372
|
+
{ text: 'Cancel', onPress: () => resolve(null), style: 'cancel' },
|
|
373
|
+
{ text: 'OK', onPress: (password) => resolve(password || null) },
|
|
374
|
+
],
|
|
375
|
+
'secure-text'
|
|
376
|
+
);
|
|
377
|
+
});
|
|
378
|
+
},
|
|
379
|
+
});
|
|
380
|
+
```
|
|
375
381
|
|
|
376
|
-
##
|
|
382
|
+
## Related Hooks
|
|
377
383
|
|
|
378
|
-
- [`useAuth`](./useAuth.md) -
|
|
379
|
-
- [`useSignOut`](./useAuth.md) -
|
|
380
|
-
- [`useUserProfile`](./useUserProfile.md) -
|
|
384
|
+
- [`useAuth`](./useAuth.md) - Main auth state management
|
|
385
|
+
- [`useSignOut`](./useAuth.md) - Sign out function
|
|
386
|
+
- [`useUserProfile`](./useUserProfile.md) - Profile information
|