@umituz/react-native-auth 3.4.33 → 3.4.34
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/application/README.md +323 -442
- package/src/domain/ConfigAndErrors.md +296 -431
- package/src/domain/README.md +361 -210
- package/src/domain/entities/AuthUser.md +231 -372
- package/src/domain/entities/UserProfile.md +271 -441
- package/src/infrastructure/README.md +388 -444
- package/src/infrastructure/services/README.md +386 -312
- package/src/presentation/README.md +631 -563
- package/src/presentation/components/README.md +254 -92
- package/src/presentation/hooks/README.md +247 -83
- package/src/presentation/screens/README.md +151 -153
|
@@ -1,198 +1,196 @@
|
|
|
1
1
|
# Auth Screens
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Pre-built screen components for authentication flows.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **[`RegisterScreen`](./RegisterScreen.tsx)** - Kayıt ekranı
|
|
9
|
-
- **[`AccountScreen`](./AccountScreen.tsx)** - Hesap ayarları ekranı
|
|
10
|
-
- **[`EditProfileScreen`](./EditProfileScreen.tsx)** - Profil düzenleme ekranı
|
|
7
|
+
## Strategy
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
**Purpose**: Provides complete authentication screens ready to use in navigation.
|
|
10
|
+
|
|
11
|
+
**When to Use**:
|
|
12
|
+
- Need complete auth screens
|
|
13
|
+
- Want consistent auth UI
|
|
14
|
+
- Rapid development
|
|
15
|
+
- Standard auth flows
|
|
16
|
+
|
|
17
|
+
**Location**: `src/presentation/screens/`
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Available Screens
|
|
13
22
|
|
|
14
23
|
### LoginScreen
|
|
15
24
|
|
|
25
|
+
**Purpose**: Complete login screen with form and social options
|
|
26
|
+
|
|
27
|
+
**When to Use**:
|
|
28
|
+
- App login entry point
|
|
29
|
+
- Need login screen
|
|
30
|
+
- Want pre-built solution
|
|
31
|
+
|
|
32
|
+
**Import Path**:
|
|
16
33
|
```typescript
|
|
17
34
|
import { LoginScreen } from '@umituz/react-native-auth';
|
|
18
|
-
|
|
19
|
-
function App() {
|
|
20
|
-
return (
|
|
21
|
-
<Stack.Navigator>
|
|
22
|
-
<Stack.Screen
|
|
23
|
-
name="Login"
|
|
24
|
-
component={LoginScreen}
|
|
25
|
-
options={{ headerShown: false }}
|
|
26
|
-
/>
|
|
27
|
-
</Stack.Navigator>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
35
|
```
|
|
31
36
|
|
|
37
|
+
**File**: `LoginScreen.tsx`
|
|
38
|
+
|
|
39
|
+
**Rules**:
|
|
40
|
+
- MUST configure navigation
|
|
41
|
+
- MUST handle auth callbacks
|
|
42
|
+
- MUST integrate with app navigation
|
|
43
|
+
- MUST NOT bypass AuthProvider
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
32
47
|
### RegisterScreen
|
|
33
48
|
|
|
49
|
+
**Purpose**: Complete registration screen with validation
|
|
50
|
+
|
|
51
|
+
**When to Use**:
|
|
52
|
+
- User registration flow
|
|
53
|
+
- Account creation
|
|
54
|
+
- Need pre-built solution
|
|
55
|
+
|
|
56
|
+
**Import Path**:
|
|
34
57
|
```typescript
|
|
35
58
|
import { RegisterScreen } from '@umituz/react-native-auth';
|
|
36
|
-
|
|
37
|
-
function App() {
|
|
38
|
-
return (
|
|
39
|
-
<Stack.Navigator>
|
|
40
|
-
<Stack.Screen
|
|
41
|
-
name="Register"
|
|
42
|
-
component={RegisterScreen}
|
|
43
|
-
options={{ headerShown: false }}
|
|
44
|
-
/>
|
|
45
|
-
</Stack.Navigator>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
59
|
```
|
|
49
60
|
|
|
61
|
+
**File**: `RegisterScreen.tsx`
|
|
62
|
+
|
|
63
|
+
**Rules**:
|
|
64
|
+
- MUST configure navigation
|
|
65
|
+
- MUST provide legal links
|
|
66
|
+
- MUST handle registration success
|
|
67
|
+
- MUST NOT bypass AuthProvider
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
50
71
|
### AccountScreen
|
|
51
72
|
|
|
73
|
+
**Purpose**: Account settings and profile management
|
|
74
|
+
|
|
75
|
+
**When to Use**:
|
|
76
|
+
- Account settings page
|
|
77
|
+
- Profile management
|
|
78
|
+
- Account operations
|
|
79
|
+
|
|
80
|
+
**Import Path**:
|
|
52
81
|
```typescript
|
|
53
82
|
import { AccountScreen } from '@umituz/react-native-auth';
|
|
54
|
-
|
|
55
|
-
function App() {
|
|
56
|
-
return (
|
|
57
|
-
<Stack.Navigator>
|
|
58
|
-
<Stack.Screen
|
|
59
|
-
name="Account"
|
|
60
|
-
component={AccountScreen}
|
|
61
|
-
options={{ title: 'Hesabım' }}
|
|
62
|
-
/>
|
|
63
|
-
</Stack.Navigator>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
83
|
```
|
|
67
84
|
|
|
85
|
+
**File**: `AccountScreen.tsx`
|
|
86
|
+
|
|
87
|
+
**Configuration**:
|
|
88
|
+
- Can customize with config prop
|
|
89
|
+
- Show/hide features
|
|
90
|
+
- Add custom actions
|
|
91
|
+
|
|
92
|
+
**Rules**:
|
|
93
|
+
- MUST only show to authenticated users
|
|
94
|
+
- MUST handle anonymous users separately
|
|
95
|
+
- MUST configure properly
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
68
99
|
### EditProfileScreen
|
|
69
100
|
|
|
101
|
+
**Purpose**: Profile editing screen
|
|
102
|
+
|
|
103
|
+
**When to Use**:
|
|
104
|
+
- Profile editing
|
|
105
|
+
- User settings
|
|
106
|
+
- Profile photo update
|
|
107
|
+
|
|
108
|
+
**Import Path**:
|
|
70
109
|
```typescript
|
|
71
110
|
import { EditProfileScreen } from '@umituz/react-native-auth';
|
|
72
|
-
|
|
73
|
-
function App() {
|
|
74
|
-
return (
|
|
75
|
-
<Stack.Navigator>
|
|
76
|
-
<Stack.Screen
|
|
77
|
-
name="EditProfile"
|
|
78
|
-
component={EditProfileScreen}
|
|
79
|
-
options={{ title: 'Profili Düzenle' }}
|
|
80
|
-
/>
|
|
81
|
-
</Stack.Navigator>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
111
|
```
|
|
85
112
|
|
|
86
|
-
|
|
113
|
+
**File**: `EditProfileScreen.tsx`
|
|
87
114
|
|
|
88
|
-
|
|
115
|
+
**Configuration**:
|
|
116
|
+
- Show/hide avatar editing
|
|
117
|
+
- Allow/disallow email change
|
|
118
|
+
- Custom validation rules
|
|
89
119
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<NavigationContainer>
|
|
96
|
-
<AuthNavigator />
|
|
97
|
-
</NavigationContainer>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
```
|
|
120
|
+
**Rules**:
|
|
121
|
+
- MUST validate before saving
|
|
122
|
+
- MUST handle photo uploads
|
|
123
|
+
- MUST show errors appropriately
|
|
101
124
|
|
|
102
|
-
|
|
125
|
+
---
|
|
103
126
|
|
|
104
|
-
|
|
127
|
+
## Navigation Integration
|
|
105
128
|
|
|
106
|
-
|
|
107
|
-
import { AccountScreen } from '@umituz/react-native-auth';
|
|
129
|
+
### Navigation Setup
|
|
108
130
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
benefits: ['Premium içeriklere erişim', 'Reklamsız deneyim'],
|
|
115
|
-
}}
|
|
116
|
-
/>
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
```
|
|
131
|
+
**RULES**:
|
|
132
|
+
- MUST wrap with NavigationContainer
|
|
133
|
+
- MUST use proper stack navigator
|
|
134
|
+
- MUST set screen options
|
|
135
|
+
- MUST handle navigation callbacks
|
|
120
136
|
|
|
121
|
-
|
|
137
|
+
**SCREEN OPTIONS**:
|
|
138
|
+
- `headerShown: false` - Hide default header
|
|
139
|
+
- `gestureEnabled: false` - Disable gestures (optional)
|
|
140
|
+
- Custom header components
|
|
122
141
|
|
|
123
|
-
|
|
124
|
-
import { EditProfileScreen } from '@umituz/react-native-auth';
|
|
142
|
+
---
|
|
125
143
|
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<EditProfileScreen
|
|
129
|
-
config={{
|
|
130
|
-
showAvatar: true,
|
|
131
|
-
allowEmailChange: false,
|
|
132
|
-
maxDisplayNameLength: 50,
|
|
133
|
-
}}
|
|
134
|
-
/>
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
```
|
|
144
|
+
## Configuration
|
|
138
145
|
|
|
139
|
-
|
|
146
|
+
### Screen Configuration
|
|
140
147
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
/>
|
|
177
|
-
<Stack.Screen
|
|
178
|
-
name="EditProfile"
|
|
179
|
-
component={EditProfileScreen}
|
|
180
|
-
options={{ title: 'Profili Düzenle' }}
|
|
181
|
-
/>
|
|
182
|
-
|
|
183
|
-
{/* Diğer ekranlar */}
|
|
184
|
-
<Stack.Screen name="Home" component={HomeScreen} />
|
|
185
|
-
</Stack.Navigator>
|
|
186
|
-
</NavigationContainer>
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
```
|
|
148
|
+
**ACCOUNT SCREEN**:
|
|
149
|
+
- `showChangePassword` - Show password change option
|
|
150
|
+
- `benefits` - List of account benefits
|
|
151
|
+
- Custom actions
|
|
152
|
+
|
|
153
|
+
**EDIT PROFILE SCREEN**:
|
|
154
|
+
- `showAvatar` - Enable avatar editing
|
|
155
|
+
- `allowEmailChange` - Allow email modification
|
|
156
|
+
- `maxDisplayNameLength` - Validation limit
|
|
157
|
+
|
|
158
|
+
**Rules**:
|
|
159
|
+
- MUST pass valid config
|
|
160
|
+
- MUST handle config changes
|
|
161
|
+
- MUST not pass invalid options
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Best Practices
|
|
166
|
+
|
|
167
|
+
### Screen Composition
|
|
168
|
+
|
|
169
|
+
**RULES**:
|
|
170
|
+
- SHOULD use pre-built screens when possible
|
|
171
|
+
- MUST configure screens properly
|
|
172
|
+
- MUST handle navigation state
|
|
173
|
+
- MUST integrate with AuthProvider
|
|
174
|
+
|
|
175
|
+
**MUST NOT**:
|
|
176
|
+
- Bypass AuthProvider
|
|
177
|
+
- Break navigation flow
|
|
178
|
+
- Ignore configuration options
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### Error Handling
|
|
190
183
|
|
|
191
|
-
|
|
184
|
+
**RULES**:
|
|
185
|
+
- MUST handle auth errors in screens
|
|
186
|
+
- MUST show user-friendly messages
|
|
187
|
+
- MUST allow user retry
|
|
188
|
+
- MUST not crash on errors
|
|
192
189
|
|
|
193
|
-
|
|
194
|
-
- **[Auth Hooks](../hooks/README.md)** - Auth hook'ları
|
|
190
|
+
---
|
|
195
191
|
|
|
196
|
-
##
|
|
192
|
+
## Related Documentation
|
|
197
193
|
|
|
198
|
-
- **
|
|
194
|
+
- **Components**: `../components/README.md`
|
|
195
|
+
- **Hooks**: `../hooks/README.md`
|
|
196
|
+
- **Services**: `../../infrastructure/services/README.md`
|