From 84102a94539789d9f1b37ff5e4cbee5d2500b122 Mon Sep 17 00:00:00 2001 From: rxmox Date: Fri, 1 May 2026 23:18:30 -0600 Subject: [PATCH 1/6] Restore LinkedIn login on web build The shared loginWithLinkedIn helper hardcoded ?platform=mobile and used WebBrowser.openAuthSessionAsync with a custom-scheme redirect, which broke the Expo web export at https://shatter-mobile.vercel.app/. After LinkedIn auth completed, the backend redirected the browser to shattermobile://auth/auth/callback?code=..., a custom scheme browsers cannot follow. Branch on Platform.OS: on web, navigate the current tab directly to the backend's /api/auth/linkedin (no platform param). The backend defaults to the web flow and redirects to ${FRONTEND_URL}/auth/callback?code=..., which the existing app/auth/callback.tsx route handles. The mobile path is unchanged. --- shatter-mobile/src/services/linkedin_auth.service.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shatter-mobile/src/services/linkedin_auth.service.ts b/shatter-mobile/src/services/linkedin_auth.service.ts index 1bb6891..c9aaf94 100644 --- a/shatter-mobile/src/services/linkedin_auth.service.ts +++ b/shatter-mobile/src/services/linkedin_auth.service.ts @@ -1,5 +1,6 @@ import * as Linking from "expo-linking"; import * as WebBrowser from "expo-web-browser"; +import { Platform } from "react-native"; import { User } from "../interfaces/User"; import { exchangeLinkedInCode, userFetch } from "./user.service"; @@ -8,6 +9,11 @@ const REDIRECT_SCHEME = "shattermobile://auth"; export async function loginWithLinkedIn(): Promise< { user: User; token: string } | null > { + if (Platform.OS === "web") { + window.location.href = `${process.env.EXPO_PUBLIC_API_BASE}/api/auth/linkedin`; + return null; + } + const result = await WebBrowser.openAuthSessionAsync( `${process.env.EXPO_PUBLIC_API_BASE}/api/auth/linkedin?platform=mobile`, REDIRECT_SCHEME, From 91ebf1c7deb6a53cc5caefa244ef84a64f57ab08 Mon Sep 17 00:00:00 2001 From: Tahamina Date: Sat, 2 May 2026 02:03:37 -0600 Subject: [PATCH 2/6] Update Callback.tsx - autoconstruct userurl - --- shatter-mobile/app/auth/callback.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/shatter-mobile/app/auth/callback.tsx b/shatter-mobile/app/auth/callback.tsx index bcfd73f..d270f78 100644 --- a/shatter-mobile/app/auth/callback.tsx +++ b/shatter-mobile/app/auth/callback.tsx @@ -11,7 +11,7 @@ import { ActivityIndicator, Text, View } from "react-native"; export default function AuthCallback() { const { code } = useLocalSearchParams<{ code: string }>(); - const { authenticate, authStorage } = useAuth(); + const { authenticate } = useAuth(); const [error, setError] = useState(""); useEffect(() => { @@ -28,11 +28,15 @@ export default function AuthCallback() { // Fetch full user profile using returned userId + token const userData = await userFetch(response.userId, response.token); + const existingSocialLinks = userData.user.socialLinks ?? {}; + const linkedinUrl = existingSocialLinks.linkedin + ?? `https://www.linkedin.com/in/${userData.user.name.toLowerCase().replace(/\s+/g, "-")}/`; + const user: User = { _id: response.userId, name: userData.user.name, email: userData.user.email, - socialLinks: userData.user.socialLinks ?? {}, + socialLinks: { ...existingSocialLinks, linkedin: linkedinUrl }, profilePhoto: userData.user.profilePhoto, isGuest: false, }; @@ -40,9 +44,8 @@ export default function AuthCallback() { // Store user + JWT in auth context await authenticate(user, response.token, false); - // Update stored user with LinkedIn data - const token = authStorage.accessToken; - userUpdate(response.userId, user, token); + // Persist LinkedIn URL to backend using the token from the exchange response + userUpdate(response.userId, user, response.token); router.replace("/JoinEventPage"); } catch (err) { setError((err as Error).message || "Authentication failed."); From cb228bc709f0c960843be4f278be2aed82cf1789 Mon Sep 17 00:00:00 2001 From: Tahamina Date: Sat, 2 May 2026 03:49:15 -0600 Subject: [PATCH 3/6] Updating sign up form to include social links - used the same styling from guest for social links --- .../components/login-signup/SignupForm.tsx | 60 ++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/shatter-mobile/src/components/login-signup/SignupForm.tsx b/shatter-mobile/src/components/login-signup/SignupForm.tsx index fe9c5de..eec029d 100644 --- a/shatter-mobile/src/components/login-signup/SignupForm.tsx +++ b/shatter-mobile/src/components/login-signup/SignupForm.tsx @@ -1,6 +1,8 @@ //called by Profile.tsx for signing up import { User } from "@/src/interfaces/User"; +import { SocialLinks } from "@/src/interfaces/User"; import { userSignup, userUpdate } from "@/src/services/user.service"; +import { FontAwesome, Feather } from "@expo/vector-icons"; import { router, Stack } from "expo-router"; import * as WebBrowser from "expo-web-browser"; import { useState } from "react"; @@ -18,6 +20,7 @@ import { import { SafeAreaView } from "react-native-safe-area-context"; import { SignUpFormStyling as styles } from "../../styling/SignUpFormStyling.styles"; import { useAuth } from "../context/AuthContext"; +import { colors } from "@/src/styling/constants"; export default function SignUpForm() { const { authenticate } = useAuth(); @@ -26,6 +29,10 @@ export default function SignUpForm() { const [password, setPassword] = useState(""); const [loading, setLoading] = useState(false); const [err, setError] = useState(""); + const [selectedType, setSelectedType] = useState<"linkedin" | "github" | "other" | null>(null); + const [linkedin, setLinkedin] = useState(""); + const [github, setGithub] = useState(""); + const [other, setOther] = useState(""); const handleLinkedIn = async () => { await WebBrowser.openBrowserAsync( @@ -76,11 +83,16 @@ export default function SignUpForm() { setError("User info could not be created. Please try again later."); } + const socialLinks: SocialLinks = {}; + if (linkedin.trim()) socialLinks.linkedin = linkedin.trim(); + if (github.trim()) socialLinks.github = github.trim(); + if (other.trim()) socialLinks.other = [{ label: "Contact Link", url: other.trim() }]; + const user: User = { _id: userResponse.userId, name, email, - socialLinks: {}, + socialLinks, profilePhoto: profilePhoto, isGuest: false, }; @@ -147,6 +159,52 @@ export default function SignUpForm() { placeholderTextColor="#888" /> + Contact Link + + setSelectedType("linkedin")} + style={{ padding: 12, borderRadius: 12, backgroundColor: selectedType === "linkedin" ? "#0A66C2" : colors.lightGrey2, flex: 1, marginRight: 8, alignItems: "center" }} + > + + + setSelectedType("github")} + style={{ padding: 12, borderRadius: 12, backgroundColor: selectedType === "github" ? "#24292e" : colors.lightGrey2, flex: 1, marginRight: 8, alignItems: "center" }} + > + + + setSelectedType("other")} + style={{ padding: 12, borderRadius: 12, backgroundColor: selectedType === "other" ? "#6c63ff" : colors.lightGrey2, flex: 1, alignItems: "center" }} + > + + + + + {selectedType && ( + { + if (selectedType === "linkedin") setLinkedin(text); + else if (selectedType === "github") setGithub(text); + else setOther(text); + }} + autoCapitalize="none" + keyboardType="url" + /> + )} + + + Select a platform above, then enter your profile link. + + Date: Sat, 2 May 2026 04:00:44 -0600 Subject: [PATCH 4/6] Update on layout to avoid moving around - position fixed for layout --- shatter-mobile/app/_layout.tsx | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/shatter-mobile/app/_layout.tsx b/shatter-mobile/app/_layout.tsx index 75e09ac..27e5f74 100644 --- a/shatter-mobile/app/_layout.tsx +++ b/shatter-mobile/app/_layout.tsx @@ -105,11 +105,23 @@ export default function RootLayout() { return ( From 61a604dc3dbbae67eb6ed08d89f98941097ab966 Mon Sep 17 00:00:00 2001 From: Tahamina Date: Sat, 2 May 2026 04:13:16 -0600 Subject: [PATCH 5/6] back to og --- shatter-mobile/app/_layout.tsx | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/shatter-mobile/app/_layout.tsx b/shatter-mobile/app/_layout.tsx index 27e5f74..75e09ac 100644 --- a/shatter-mobile/app/_layout.tsx +++ b/shatter-mobile/app/_layout.tsx @@ -105,23 +105,11 @@ export default function RootLayout() { return ( From 0fa225b186caccfc33b26eb28062ed6eff52175e Mon Sep 17 00:00:00 2001 From: Tahamina Date: Sat, 2 May 2026 04:21:46 -0600 Subject: [PATCH 6/6] styling changes to show the background and logo --- shatter-mobile/src/styling/SignUpFormStyling.styles.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shatter-mobile/src/styling/SignUpFormStyling.styles.ts b/shatter-mobile/src/styling/SignUpFormStyling.styles.ts index 872ee9e..77545f6 100644 --- a/shatter-mobile/src/styling/SignUpFormStyling.styles.ts +++ b/shatter-mobile/src/styling/SignUpFormStyling.styles.ts @@ -11,7 +11,7 @@ export const SignUpFormStyling = StyleSheet.create({ background: { flex: 1, width: "100%", - height: "50%", + height: "100%", }, safe: { flex: 1,