diff --git a/README.md b/README.md
index c30648e..dd2337c 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
A comprehensive React Native (Expo) template powered by Ignite CLI and Parse Server, providing production-ready authentication solutions including email/password authentication, Google Sign-In integration, session persistence, and password reset functionality.
[](https://github.com/your-org/ignite-parse-auth-kit/actions)
-[](https://codecov.io/gh/neweracy/ignite-parse-auth-kit)
+[](https://codecov.io/gh/neweracy/IgniteParseAuthKit)
[](https://www.npmjs.com/package/ignite-parse-auth-kit)
[](LICENSE)
[](CONTRIBUTING.md)
@@ -105,6 +105,7 @@ The AuthContext provides a comprehensive API for handling all authentication sce
### Code Examples
#### Email/Password Login
+
```tsx
import { useAuth } from '@/context/AuthContext'
@@ -124,18 +125,22 @@ export function LoginScreen() {
}
return (
- // Your UI components here
-
+
+ {/* Your login form UI here */}
+
+ {error && {error}}
+
)
}
```
#### User Registration
+
```tsx
import { useAuth } from '@/context/AuthContext'
-export function SignupScreen() {
- const { setAuthEmail, setAuthPassword, signUp, isLoading } = useAuth()
+export function RegisterScreen() {
+ const { setAuthEmail, setAuthPassword, signUp, isLoading, error } = useAuth()
const handleSignUp = async () => {
setAuthEmail('newuser@example.com')
@@ -143,88 +148,108 @@ export function SignupScreen() {
const result = await signUp('unique_username')
if (result.success) {
- // User created and automatically logged in
console.log('Account created successfully!')
+ } else {
+ console.error('Registration failed:', result.error)
}
}
return (
-
+
+ {/* Your registration form UI here */}
+
+ {error && {error}}
+
)
}
```
#### Password Reset
+
```tsx
import { useAuth } from '@/context/AuthContext'
-export function ForgotPasswordScreen() {
+export function PasswordResetScreen() {
const { requestPasswordReset } = useAuth()
+ const [email, setEmail] = useState('')
- const handlePasswordReset = async (email: string) => {
+ const handlePasswordReset = async () => {
const result = await requestPasswordReset(email)
if (result.success) {
- // Password reset email sent
- showSuccessMessage('Password reset email sent!')
+ Alert.alert('Success', result.message || 'Password reset email sent!')
} else {
- showErrorMessage(result.error)
+ Alert.alert('Error', result.error || 'Failed to send reset email')
}
}
return (
-
+
+
+
+
)
}
```
#### Google Sign-In
+
```tsx
import { useAuth } from '@/context/AuthContext'
-import { GoogleSignin } from '@react-native-google-signin/google-signin'
-export function SocialLoginScreen() {
+export function GoogleSignInScreen() {
const { googleSignIn } = useAuth()
const handleGoogleSignIn = async () => {
try {
- // Get Google auth response via Expo AuthSession
+ // You'll need to implement getGoogleAuthResponse using Expo AuthSession
const googleResponse = await getGoogleAuthResponse()
const result = await googleSignIn(googleResponse)
if (result.success) {
console.log('Google sign-in successful!')
+ } else {
+ console.error('Google sign-in failed:', result.error)
}
} catch (error) {
- console.error('Google sign-in failed:', error)
+ console.error('Google sign-in error:', error)
}
}
return (
-
+
+
+
)
}
```
#### Server Health Check
+
```tsx
import { useAuth } from '@/context/AuthContext'
+import { useEffect } from 'react'
export function ServerStatusComponent() {
const { checkServerStatus } = useAuth()
- const verifyServerConnection = async () => {
- const status = await checkServerStatus()
-
- if (status.isRunning) {
- console.log('✅ Parse Server is running')
- } else {
- console.error('❌ Server unavailable:', status.message)
+ useEffect(() => {
+ const verifyServerConnection = async () => {
+ const status = await checkServerStatus()
+
+ if (status.isRunning) {
+ console.log('✅ Parse Server is running')
+ } else {
+ console.error('❌ Server unavailable:', status.message)
+ }
}
- }
- useEffect(() => {
verifyServerConnection()
- }, [])
+ }, [checkServerStatus])
return null
}