Skip to content

Conversation

@stephenhungg
Copy link
Contributor

What's new in this PR

Description

  • Create AuthContext.tsx in utils folder with AsyncStorage persistence
  • Wrap app with AuthProvider in _layout.tsx
  • Add login/signup integration with context
  • Create dashboard page for authenticated users
  • Implement stay signed in feature with checkbox
  • Add smart routing based on authentication state
  • Include loading states and error handling
  • All code formatted with prettier

Screenshots

No

How to review

AuthContext.tsx

Next steps

Idk

Relevant links

Online sources

CURSOR!!!

Related PRs

CC: @rachaelch3n

- Create AuthContext.tsx in utils folder with AsyncStorage persistence
- Wrap app with AuthProvider in _layout.tsx
- Add login/signup integration with context
- Create dashboard page for authenticated users
- Implement stay signed in feature with checkbox
- Add smart routing based on authentication state
- Include loading states and error handling
- All code formatted with prettier
@jeannineruiz
Copy link
Contributor

WHY IS THIS PR SO HUGE

api/config.ts Outdated
@@ -0,0 +1,67 @@
// API Configuration for Rails Backend
const BASE_URL =
process.env.EXPO_PUBLIC_API_BASE_URL || 'http:/10.2.193.239:3000';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supposed to be http://

@jeannineruiz
Copy link
Contributor

Nice.

@rachaelch3n rachaelch3n removed the request for review from kevin3656 November 6, 2025 23:40
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for renaming

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also thanks

const handleLogin = async () => {
try {
setIsLoading(true);
console.log('Logging in with:', { email, password });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get rid of this console log. dont want to leak sensitive info

api/config.ts Outdated
@@ -0,0 +1,67 @@
// API Configuration for Rails Backend
const BASE_URL =
process.env.EXPO_PUBLIC_API_BASE_URL || 'http:/10.2.193.239:3000';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets not hardcode our IP into the main branch. can you change the fallback to "http://localhost:3000" instead. your .env should hold your own IP address

<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="auth/login" options={{ headerShown: false }} />
<Stack.Screen name="auth/signup" options={{ headerShown: false }} />
<Stack.Screen name="dashboard" options={{ headerShown: false }} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get rid of the dashboard? it's a good way to check if signup is successful but we are going to change this later.

setDriver(driverData);

if (staySignedIn) {
console.log('Saving driver to storage:', driverData);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marking

setDriver(newDriver);

if (staySignedIn) {
console.log('Saving driver to storage:', newDriver);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marking

};

const logout = async () => {
console.log('Logging out, clearing storage');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marking

};

await login(loginData, staySignedIn);
console.log('Login successful');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marking

{ text: 'OK', onPress: () => router.push('/dashboard') },
]);
} catch (error) {
console.error('Signup error:', error);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marking

@rachaelch3n rachaelch3n merged commit 77b9b6e into main Jan 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants