react-native-linkedin-oauth2 1.1.0 → 1.1.1

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/dist/index.d.ts CHANGED
@@ -1,2 +1,200 @@
1
- export declare const loginLinkedIn: () => void;
1
+ /**
2
+ * @file index.tsx
3
+ * @author NikhilRW
4
+ * @description A React Native component that implements LinkedIn OAuth2 authentication
5
+ * using a WebView. It handles the authorization code flow, token exchange, and user profile retrieval.
6
+ *
7
+ * @requires react-native-webview
8
+ * @requires react-native
9
+ * @requires react
10
+ */
11
+ import React from 'react';
12
+ import { type ModalProps, type ViewStyle, type StyleProp } from 'react-native';
13
+ /**
14
+ * Represents the user profile data returned from LinkedIn's /userinfo endpoint.
15
+ * This follows the OpenID Connect standard claims.
16
+ *
17
+ * @interface LinkedInProfile
18
+ */
19
+ export interface LinkedInProfile {
20
+ /**
21
+ * The unique identifier for the user (Subject).
22
+ * This is a stable identifier for the user.
23
+ */
24
+ sub: string;
25
+ /**
26
+ * Whether the user's email address has been verified by LinkedIn.
27
+ */
28
+ email_verified?: boolean;
29
+ /**
30
+ * The full name of the user.
31
+ */
32
+ name: string;
33
+ /**
34
+ * The user's locale information.
35
+ */
36
+ locale: {
37
+ /** The country code (e.g., US). */
38
+ country: string;
39
+ /** The language code (e.g., en). */
40
+ language: string;
41
+ };
42
+ /**
43
+ * The user's given name (first name).
44
+ */
45
+ given_name: string;
46
+ /**
47
+ * The user's family name (last name).
48
+ */
49
+ family_name: string;
50
+ /**
51
+ * The user's email address.
52
+ * Only present if the 'email' scope was requested and granted.
53
+ */
54
+ email?: string;
55
+ /**
56
+ * URL to the user's profile picture.
57
+ */
58
+ picture: string;
59
+ /**
60
+ * Allow for additional properties that might be returned by the API.
61
+ */
62
+ [key: string]: any;
63
+ }
64
+ /**
65
+ * Represents the response from the LinkedIn Access Token endpoint.
66
+ *
67
+ * @interface LinkedInTokenResponse
68
+ */
69
+ export interface LinkedInTokenResponse {
70
+ /**
71
+ * The access token used to authorize API requests.
72
+ */
73
+ access_token: string;
74
+ /**
75
+ * The duration in seconds until the access token expires.
76
+ */
77
+ expires_in: number;
78
+ /**
79
+ * The scope of access granted by the token.
80
+ */
81
+ scope: string;
82
+ /**
83
+ * The type of token (usually "Bearer").
84
+ */
85
+ token_type: string;
86
+ /**
87
+ * The ID token (if OpenID Connect scopes were requested).
88
+ */
89
+ id_token?: string;
90
+ }
91
+ /**
92
+ * Props for the LinkedInModal component.
93
+ *
94
+ * @interface LinkedInModalProps
95
+ */
96
+ export interface LinkedInModalProps {
97
+ /**
98
+ * Controls the visibility of the modal.
99
+ */
100
+ isVisible: boolean;
101
+ /**
102
+ * The Client ID obtained from the LinkedIn Developer Portal.
103
+ * Required for authentication.
104
+ */
105
+ clientId?: string;
106
+ /**
107
+ * The Client Secret obtained from the LinkedIn Developer Portal.
108
+ * Required for exchanging the authorization code for an access token.
109
+ * @warning Do not expose this in client-side code if possible; consider using a backend proxy for high security.
110
+ */
111
+ clientSecret?: string;
112
+ /**
113
+ * A space-separated list of permissions to request.
114
+ * Common scopes: 'openid', 'email', 'profile', 'w_member_social'.
115
+ * @default 'openid email profile'
116
+ */
117
+ scope?: string;
118
+ /**
119
+ * The Redirect URI registered in the LinkedIn Developer Portal.
120
+ * This must match exactly what is configured in the portal.
121
+ */
122
+ redirectUri?: string;
123
+ /**
124
+ * Callback function triggered when login is successful.
125
+ * @param {LinkedInProfile} user - The profile data of the authenticated user.
126
+ */
127
+ onSuccess?: (user: LinkedInProfile) => void;
128
+ /**
129
+ * Callback function triggered when an error occurs during authentication.
130
+ * @param {Error} error - The error object containing details about the failure.
131
+ */
132
+ onError?: (error: Error) => void;
133
+ /**
134
+ * Callback function triggered when the modal is closed (e.g., by the user or after success).
135
+ */
136
+ onClose?: () => void;
137
+ /**
138
+ * If true, the component will attempt to log the user out of LinkedIn.
139
+ * @default false
140
+ */
141
+ logout?: boolean;
142
+ /**
143
+ * Callback function triggered when the logout process is complete.
144
+ */
145
+ onLogout?: () => void;
146
+ /**
147
+ * Custom function to render the header of the modal.
148
+ * @param {Object} props - Props passed to the header renderer.
149
+ * @param {function} props.onClose - Function to close the modal.
150
+ * @returns {React.ReactNode} The custom header component.
151
+ */
152
+ renderHeader?: (props: {
153
+ onClose: () => void;
154
+ }) => React.ReactNode;
155
+ /**
156
+ * Custom function to render the loading indicator.
157
+ * @returns {React.ReactNode} The custom loading component.
158
+ */
159
+ renderLoading?: () => React.ReactNode;
160
+ /**
161
+ * Style object for the SafeAreaView container.
162
+ */
163
+ containerStyle?: StyleProp<ViewStyle>;
164
+ /**
165
+ * Style object for the inner wrapper View.
166
+ */
167
+ wrapperStyle?: StyleProp<ViewStyle>;
168
+ /**
169
+ * Whether to automatically close the modal after a successful login.
170
+ * @default true
171
+ */
172
+ closeOnSuccess?: boolean;
173
+ /**
174
+ * Additional props to pass to the underlying React Native Modal component.
175
+ * @see https://reactnative.dev/docs/modal
176
+ */
177
+ modalProps?: Partial<Omit<ModalProps, 'visible'>>;
178
+ }
179
+ /**
180
+ * LinkedInModal Component.
181
+ *
182
+ * A modal component that loads a WebView to handle LinkedIn OAuth2 authentication.
183
+ *
184
+ * @component
185
+ * @example
186
+ * ```tsx
187
+ * <LinkedInModal
188
+ * isVisible={showLinkedInModal}
189
+ * clientId="YOUR_CLIENT_ID"
190
+ * clientSecret="YOUR_CLIENT_SECRET"
191
+ * redirectUri="YOUR_REDIRECT_URI"
192
+ * onSuccess={(user) => console.log(user)}
193
+ * onError={(error) => console.error(error)}
194
+ * onClose={() => setShowLinkedInModal(false)}
195
+ * />
196
+ * ```
197
+ */
198
+ export declare const LinkedInModal: React.FC<LinkedInModalProps>;
199
+ export default LinkedInModal;
2
200
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,YAEzB,CAAC"}
1
+ {"version":3,"file":"index.d.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,MAAM,CAAC;IAEf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAE5C;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IAEnE;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAEtC;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEtC;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEpC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;CACnD;AA8LD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiJtD,CAAC;AAkDF,eAAe,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,648 @@
1
- export const loginLinkedIn = () => {
2
- console.log('Logging In In Your App Using Linkedin !!! ');
1
+ /**
2
+ * @file index.tsx
3
+ * @author NikhilRW
4
+ * @description A React Native component that implements LinkedIn OAuth2 authentication
5
+ * using a WebView. It handles the authorization code flow, token exchange, and user profile retrieval.
6
+ *
7
+ * @requires react-native-webview
8
+ * @requires react-native
9
+ * @requires react
10
+ */
11
+ import React, { useRef, useState, useEffect, } from 'react';
12
+ import { ActivityIndicator, StyleSheet, View, Modal, TouchableOpacity, Text, SafeAreaView, } from 'react-native';
13
+ import WebView, {} from 'react-native-webview';
14
+ import {} from 'react-native-webview/lib/WebViewTypes';
15
+ // --- Constants ---
16
+ /**
17
+ * LinkedIn API endpoints used for authentication and data retrieval.
18
+ */
19
+ const LINKEDIN_URLS = {
20
+ /** URL for the authorization request. */
21
+ AUTHORIZATION: 'https://www.linkedin.com/oauth/v2/authorization',
22
+ /** URL for exchanging the authorization code for an access token. */
23
+ ACCESS_TOKEN: 'https://www.linkedin.com/oauth/v2/accessToken',
24
+ /** URL for fetching user information. */
25
+ USER_INFO: 'https://api.linkedin.com/v2/userinfo',
26
+ /** URL for logging out the user. */
27
+ LOG_OUT: 'https://www.linkedin.com/m/logout',
3
28
  };
29
+ // --- Helper Functions ---
30
+ /**
31
+ * Constructs the LinkedIn authorization URL.
32
+ *
33
+ * @param {string} clientId - The LinkedIn Client ID.
34
+ * @param {string} scope - The requested scopes.
35
+ * @param {string} redirectUri - The redirect URI.
36
+ * @returns {string} The fully constructed authorization URL.
37
+ */
38
+ const getAuthorizationUrl = (clientId, scope, redirectUri) => {
39
+ const params = new URLSearchParams({
40
+ response_type: 'code',
41
+ client_id: clientId,
42
+ redirect_uri: redirectUri,
43
+ scope: scope,
44
+ });
45
+ return `${LINKEDIN_URLS.AUTHORIZATION}?${params.toString()}`;
46
+ };
47
+ /**
48
+ * Handles the LinkedIn authentication callback.
49
+ * Exchanges the authorization code for an access token and fetches the user profile.
50
+ *
51
+ * @param {HandleAuthCallbackParams} params - The parameters for authentication.
52
+ * @param {string} params.url - The callback URL containing the authorization code.
53
+ * @param {string} params.clientId - The LinkedIn Client ID.
54
+ * @param {string} params.clientSecret - The LinkedIn Client Secret.
55
+ * @param {string} params.redirectUri - The redirect URI used in the initial authorization request.
56
+ * @param {function} params.onSuccess - Callback function called with the profile data on success.
57
+ * @param {function} params.onError - Callback function called with an error object on failure.
58
+ * @param {function} params.setIsLoading - State setter to control the loading indicator.
59
+ * @returns {Promise<void>}
60
+ */
61
+ const handleAuthCallback = async ({ url, clientId, clientSecret, redirectUri, onSuccess, onError, setIsLoading, }) => {
62
+ try {
63
+ setIsLoading(true);
64
+ const params = new URL(url).searchParams;
65
+ const authCode = params.get('code');
66
+ const errorDescription = params.get('error_description');
67
+ if (errorDescription) {
68
+ throw new Error(errorDescription);
69
+ }
70
+ if (!authCode) {
71
+ throw new Error('Authentication failed. No authorization code found.');
72
+ }
73
+ const tokenParams = new URLSearchParams({
74
+ grant_type: 'authorization_code',
75
+ code: authCode,
76
+ client_id: clientId,
77
+ client_secret: clientSecret,
78
+ redirect_uri: redirectUri,
79
+ });
80
+ const tokenResponse = await fetch(LINKEDIN_URLS.ACCESS_TOKEN, {
81
+ method: 'POST',
82
+ headers: {
83
+ 'Content-Type': 'application/x-www-form-urlencoded',
84
+ },
85
+ body: tokenParams.toString(),
86
+ });
87
+ if (!tokenResponse.ok) {
88
+ const errorData = await tokenResponse.json().catch(() => ({}));
89
+ throw new Error(errorData.error_description ||
90
+ `Failed to get access token: ${tokenResponse.statusText}`);
91
+ }
92
+ const tokenData = await tokenResponse.json();
93
+ const { access_token } = tokenData;
94
+ if (!access_token) {
95
+ throw new Error('Authentication failed. No access token received.');
96
+ }
97
+ const profileResponse = await fetch(LINKEDIN_URLS.USER_INFO, {
98
+ method: 'GET',
99
+ headers: {
100
+ Authorization: `Bearer ${access_token}`,
101
+ },
102
+ });
103
+ if (!profileResponse.ok) {
104
+ const errorData = await profileResponse.json().catch(() => ({}));
105
+ throw new Error(errorData.message ||
106
+ `Failed to fetch profile: ${profileResponse.statusText}`);
107
+ }
108
+ const profileData = await profileResponse.json();
109
+ if (!profileData) {
110
+ throw new Error('Failed to parse profile data.');
111
+ }
112
+ onSuccess(profileData);
113
+ }
114
+ catch (error) {
115
+ const errorMessage = error instanceof Error ? error.message : 'An unknown error occurred';
116
+ if (errorMessage.toLowerCase().includes('network request failed')) {
117
+ onError(new Error('Network error. Please check your internet connection.'));
118
+ }
119
+ else {
120
+ onError(new Error(errorMessage));
121
+ }
122
+ }
123
+ finally {
124
+ setIsLoading(false);
125
+ }
126
+ };
127
+ // --- Components ---
128
+ /**
129
+ * Default header component for the modal.
130
+ * Displays a close button.
131
+ *
132
+ * @param {Object} props - Component props.
133
+ * @param {function} props.onClose - Function to close the modal.
134
+ */
135
+ const DefaultHeader = ({ onClose }) => (<View style={styles.defaultHeader}>
136
+ <TouchableOpacity onPress={onClose} style={styles.closeButton}>
137
+ <Text style={styles.closeButtonText}>Close</Text>
138
+ </TouchableOpacity>
139
+ </View>);
140
+ /**
141
+ * Default loading component.
142
+ * Displays an ActivityIndicator centered on the screen.
143
+ */
144
+ const DefaultLoading = () => (<View style={styles.loadingOverlay}>
145
+ <ActivityIndicator size="large" color="#0077B5"/>
146
+ </View>);
147
+ /**
148
+ * LinkedInModal Component.
149
+ *
150
+ * A modal component that loads a WebView to handle LinkedIn OAuth2 authentication.
151
+ *
152
+ * @component
153
+ * @example
154
+ * ```tsx
155
+ * <LinkedInModal
156
+ * isVisible={showLinkedInModal}
157
+ * clientId="YOUR_CLIENT_ID"
158
+ * clientSecret="YOUR_CLIENT_SECRET"
159
+ * redirectUri="YOUR_REDIRECT_URI"
160
+ * onSuccess={(user) => console.log(user)}
161
+ * onError={(error) => console.error(error)}
162
+ * onClose={() => setShowLinkedInModal(false)}
163
+ * />
164
+ * ```
165
+ */
166
+ export const LinkedInModal = ({ isVisible, clientId = '', clientSecret = '', scope = 'openid email profile', redirectUri = '', onSuccess = () => { }, onError = () => { }, onClose = () => { }, onLogout = () => { }, logout = false, renderHeader, renderLoading, containerStyle, wrapperStyle, closeOnSuccess = true, modalProps = {
167
+ animationType: 'slide',
168
+ }, }) => {
169
+ const webViewRef = useRef(null);
170
+ const [isLoading, setIsLoading] = useState(false);
171
+ const [authUrl, setAuthUrl] = useState('');
172
+ useEffect(() => {
173
+ if (isVisible && !logout && clientId && redirectUri) {
174
+ setAuthUrl(getAuthorizationUrl(clientId, scope, redirectUri));
175
+ }
176
+ }, [isVisible, logout, clientId, scope, redirectUri]);
177
+ const handleNavigationStateChange = (event) => {
178
+ const { url } = event;
179
+ if (logout) {
180
+ return true;
181
+ }
182
+ // Check if this is our redirect URL containing the authorization code
183
+ if (url.startsWith(redirectUri) && url.includes('code=')) {
184
+ handleAuthCallback({
185
+ url,
186
+ clientId,
187
+ clientSecret,
188
+ redirectUri,
189
+ onSuccess: data => {
190
+ onSuccess(data);
191
+ if (closeOnSuccess) {
192
+ onClose();
193
+ }
194
+ },
195
+ onError,
196
+ setIsLoading,
197
+ });
198
+ return false;
199
+ }
200
+ // Check for OAuth errors
201
+ if (url.includes('error=')) {
202
+ const error = new URL(url).searchParams.get('error_description') || 'Unknown error';
203
+ onError(new Error(error));
204
+ onClose();
205
+ return false;
206
+ }
207
+ return true;
208
+ };
209
+ const handleLogoutNavigation = (event) => {
210
+ if (event.url.includes('/home') ||
211
+ event.url.includes('/session_redirect') ||
212
+ event.url.includes('login')) {
213
+ onLogout();
214
+ onClose();
215
+ }
216
+ };
217
+ if (!clientId || !redirectUri || !clientSecret) {
218
+ if (!logout && isVisible) {
219
+ console.warn('LinkedInModal: Missing required props (clientId, clientSecret, or redirectUri)');
220
+ return (<View>
221
+ <Text style={styles.errorText}>
222
+ Missing required props (clientId, clientSecret, or redirectUri)
223
+ </Text>
224
+ </View>);
225
+ }
226
+ }
227
+ return (<Modal visible={isVisible} animationType={modalProps.animationType || 'slide'} onRequestClose={onClose} transparent={false} {...modalProps}>
228
+ <SafeAreaView style={[styles.container, containerStyle]}>
229
+ <View style={[styles.wrapper, wrapperStyle]}>
230
+ {renderHeader ? (renderHeader({ onClose })) : (<DefaultHeader onClose={onClose}/>)}
231
+ <View style={styles.webViewContainer}>
232
+ {logout ? (<WebView source={{ uri: LINKEDIN_URLS.LOG_OUT }} style={styles.webView} javaScriptEnabled domStorageEnabled sharedCookiesEnabled thirdPartyCookiesEnabled onNavigationStateChange={handleLogoutNavigation} onLoadStart={() => setIsLoading(true)} onLoadEnd={() => setIsLoading(false)}/>) : (<WebView ref={webViewRef} source={{ uri: authUrl }} onShouldStartLoadWithRequest={handleNavigationStateChange} onLoadStart={() => setIsLoading(true)} onLoadEnd={() => setIsLoading(false)} onError={err => onError(new Error(err.nativeEvent.description))} style={styles.webView} javaScriptEnabled domStorageEnabled startInLoadingState={true} renderLoading={() => <View />} // Handled by our custom overlay
233
+ />)}
234
+
235
+ {isLoading &&
236
+ (renderLoading ? renderLoading() : <DefaultLoading />)}
237
+ </View>
238
+ </View>
239
+ </SafeAreaView>
240
+ </Modal>);
241
+ };
242
+ const styles = StyleSheet.create({
243
+ container: {
244
+ flex: 1,
245
+ backgroundColor: '#fff',
246
+ },
247
+ wrapper: {
248
+ flex: 1,
249
+ },
250
+ webViewContainer: {
251
+ flex: 1,
252
+ position: 'relative',
253
+ },
254
+ webView: {
255
+ flex: 1,
256
+ },
257
+ loadingOverlay: {
258
+ ...StyleSheet.absoluteFillObject,
259
+ justifyContent: 'center',
260
+ alignItems: 'center',
261
+ backgroundColor: 'rgba(255, 255, 255, 0.8)',
262
+ zIndex: 1000,
263
+ },
264
+ defaultHeader: {
265
+ height: 54,
266
+ flexDirection: 'row',
267
+ justifyContent: 'flex-end',
268
+ alignItems: 'center',
269
+ paddingHorizontal: 10,
270
+ borderBottomWidth: 1,
271
+ borderBottomColor: '#e0e0e0',
272
+ backgroundColor: '#f8f8f8',
273
+ },
274
+ closeButton: {
275
+ padding: 10,
276
+ },
277
+ closeButtonText: {
278
+ fontSize: 14,
279
+ color: '#333',
280
+ fontWeight: 'bold',
281
+ },
282
+ errorText: {
283
+ color: 'red',
284
+ fontSize: 16,
285
+ fontWeight: 'bold',
286
+ textAlign: 'center',
287
+ },
288
+ });
289
+ export default LinkedInModal;
290
+ // // --- Types ---
291
+ // export interface LinkedInProfile {
292
+ // sub: string;
293
+ // email_verified?: boolean;
294
+ // name: string;
295
+ // locale: {
296
+ // country: string;
297
+ // language: string;
298
+ // };
299
+ // given_name: string;
300
+ // family_name: string;
301
+ // email?: string;
302
+ // picture: string;
303
+ // [key: string]: any;
304
+ // }
305
+ // export interface LinkedInTokenResponse {
306
+ // access_token: string;
307
+ // expires_in: number;
308
+ // scope: string;
309
+ // token_type: string;
310
+ // id_token?: string;
311
+ // }
312
+ // export interface LinkedInModalProps {
313
+ // isVisible: boolean;
314
+ // clientId?: string;
315
+ // clientSecret?: string;
316
+ // scope?: string;
317
+ // redirectUri?: string;
318
+ // onSuccess?: (user: LinkedInProfile) => void;
319
+ // onError?: (error: Error) => void;
320
+ // onClose?: () => void;
321
+ // logout?: boolean;
322
+ // onLogout?: () => void;
323
+ // renderHeader?: (props: { onClose: () => void }) => React.ReactNode;
324
+ // renderLoading?: () => React.ReactNode;
325
+ // containerStyle?: StyleProp<ViewStyle>;
326
+ // wrapperStyle?: StyleProp<ViewStyle>;
327
+ // closeOnSuccess?: boolean;
328
+ // modalProps?: Partial<Omit<ModalProps, 'visible'>>;
329
+ // }
330
+ // // --- Constants ---
331
+ // const LINKEDIN_URLS = {
332
+ // AUTHORIZATION: 'https://www.linkedin.com/oauth/v2/authorization',
333
+ // ACCESS_TOKEN: 'https://www.linkedin.com/oauth/v2/accessToken',
334
+ // USER_INFO: 'https://api.linkedin.com/v2/userinfo',
335
+ // LOG_OUT: 'https://www.linkedin.com/m/logout',
336
+ // };
337
+ // // --- Helper Functions ---
338
+ // const getAuthorizationUrl = (
339
+ // clientId: string,
340
+ // scope: string,
341
+ // redirectUri: string,
342
+ // ) => {
343
+ // const params = new URLSearchParams({
344
+ // response_type: 'code',
345
+ // client_id: clientId,
346
+ // redirect_uri: redirectUri,
347
+ // scope: scope,
348
+ // });
349
+ // return `${LINKEDIN_URLS.AUTHORIZATION}?${params.toString()}`;
350
+ // };
351
+ // interface HandleAuthCallbackParams {
352
+ // url: string;
353
+ // clientId: string;
354
+ // clientSecret: string;
355
+ // redirectUri: string;
356
+ // onSuccess: (profileData: LinkedInProfile) => void;
357
+ // onError: (error: Error) => void;
358
+ // setIsLoading: Dispatch<SetStateAction<boolean>>;
359
+ // }
360
+ // /**
361
+ // * Handles the LinkedIn authentication callback.
362
+ // * Exchanges the authorization code for an access token and fetches the user profile.
363
+ // *
364
+ // * @param {HandleAuthCallbackParams} params - The parameters for authentication.
365
+ // * @param {string} params.url - The callback URL containing the authorization code.
366
+ // * @param {string} params.clientId - The LinkedIn Client ID.
367
+ // * @param {string} params.clientSecret - The LinkedIn Client Secret.
368
+ // * @param {string} params.redirectUri - The redirect URI used in the initial authorization request.
369
+ // * @param {function} params.onSuccess - Callback function called with the profile data on success.
370
+ // * @param {function} params.onError - Callback function called with an error object on failure.
371
+ // * @param {function} params.setIsLoading - State setter to control the loading indicator.
372
+ // */
373
+ // const handleAuthCallback = async ({
374
+ // url,
375
+ // clientId,
376
+ // clientSecret,
377
+ // redirectUri,
378
+ // onSuccess,
379
+ // onError,
380
+ // setIsLoading,
381
+ // }: HandleAuthCallbackParams) => {
382
+ // try {
383
+ // setIsLoading(true);
384
+ // const params = new URL(url).searchParams;
385
+ // const authCode = params.get('code');
386
+ // const errorDescription = params.get('error_description');
387
+ // if (errorDescription) {
388
+ // throw new Error(errorDescription);
389
+ // }
390
+ // if (!authCode) {
391
+ // throw new Error('Authentication failed. No authorization code found.');
392
+ // }
393
+ // const tokenParams = new URLSearchParams({
394
+ // grant_type: 'authorization_code',
395
+ // code: authCode,
396
+ // client_id: clientId,
397
+ // client_secret: clientSecret,
398
+ // redirect_uri: redirectUri,
399
+ // });
400
+ // const tokenResponse = await fetch(LINKEDIN_URLS.ACCESS_TOKEN, {
401
+ // method: 'POST',
402
+ // headers: {
403
+ // 'Content-Type': 'application/x-www-form-urlencoded',
404
+ // },
405
+ // body: tokenParams.toString(),
406
+ // });
407
+ // if (!tokenResponse.ok) {
408
+ // const errorData = await tokenResponse.json().catch(() => ({}));
409
+ // throw new Error(
410
+ // errorData.error_description ||
411
+ // `Failed to get access token: ${tokenResponse.statusText}`,
412
+ // );
413
+ // }
414
+ // const tokenData: LinkedInTokenResponse = await tokenResponse.json();
415
+ // const { access_token } = tokenData;
416
+ // if (!access_token) {
417
+ // throw new Error('Authentication failed. No access token received.');
418
+ // }
419
+ // const profileResponse = await fetch(LINKEDIN_URLS.USER_INFO, {
420
+ // method: 'GET',
421
+ // headers: {
422
+ // Authorization: `Bearer ${access_token}`,
423
+ // },
424
+ // });
425
+ // if (!profileResponse.ok) {
426
+ // const errorData = await profileResponse.json().catch(() => ({}));
427
+ // throw new Error(
428
+ // errorData.message ||
429
+ // `Failed to fetch profile: ${profileResponse.statusText}`,
430
+ // );
431
+ // }
432
+ // const profileData: LinkedInProfile = await profileResponse.json();
433
+ // if (!profileData) {
434
+ // throw new Error('Failed to parse profile data.');
435
+ // }
436
+ // onSuccess(profileData);
437
+ // } catch (error: any) {
438
+ // const errorMessage =
439
+ // error instanceof Error ? error.message : 'An unknown error occurred';
440
+ // if (errorMessage.toLowerCase().includes('network request failed')) {
441
+ // onError(
442
+ // new Error('Network error. Please check your internet connection.'),
443
+ // );
444
+ // } else {
445
+ // onError(new Error(errorMessage));
446
+ // }
447
+ // } finally {
448
+ // setIsLoading(false);
449
+ // }
450
+ // };
451
+ // // --- Components ---
452
+ // const DefaultHeader = ({ onClose }: { onClose: () => void }) => (
453
+ // <View style={styles.defaultHeader}>
454
+ // <TouchableOpacity onPress={onClose} style={styles.closeButton}>
455
+ // <Text style={styles.closeButtonText}>x</Text>
456
+ // </TouchableOpacity>
457
+ // </View>
458
+ // );
459
+ // const DefaultLoading = () => (
460
+ // <View style={styles.loadingOverlay}>
461
+ // <ActivityIndicator size="large" color="#0077B5" />
462
+ // </View>
463
+ // );
464
+ // export const LinkedInModal: React.FC<LinkedInModalProps> = ({
465
+ // isVisible,
466
+ // clientId = '',
467
+ // clientSecret = '',
468
+ // scope = 'openid email profile',
469
+ // redirectUri = '',
470
+ // onSuccess = () => { },
471
+ // onError = () => { },
472
+ // onClose = () => { },
473
+ // onLogout = () => { },
474
+ // logout = false,
475
+ // renderHeader,
476
+ // renderLoading,
477
+ // containerStyle,
478
+ // wrapperStyle,
479
+ // closeOnSuccess = true,
480
+ // modalProps = {
481
+ // animationType: 'slide',
482
+ // },
483
+ // }) => {
484
+ // const webViewRef = useRef<WebView>(null);
485
+ // const [isLoading, setIsLoading] = useState<boolean>(false);
486
+ // const [authUrl, setAuthUrl] = useState('');
487
+ // useEffect(() => {
488
+ // if (isVisible && !logout && clientId && redirectUri) {
489
+ // setAuthUrl(getAuthorizationUrl(clientId, scope, redirectUri));
490
+ // }
491
+ // }, [isVisible, logout, clientId, scope, redirectUri]);
492
+ // const handleNavigationStateChange = (event: ShouldStartLoadRequest) => {
493
+ // const { url } = event;
494
+ // if (logout) {
495
+ // return true;
496
+ // }
497
+ // // Check if this is our redirect URL containing the authorization code
498
+ // if (url.startsWith(redirectUri) && url.includes('code=')) {
499
+ // handleAuthCallback({
500
+ // url,
501
+ // clientId,
502
+ // clientSecret,
503
+ // redirectUri,
504
+ // onSuccess: data => {
505
+ // onSuccess(data);
506
+ // if (closeOnSuccess) {
507
+ // onClose();
508
+ // }
509
+ // },
510
+ // onError,
511
+ // setIsLoading,
512
+ // });
513
+ // return false;
514
+ // }
515
+ // // Check for OAuth errors
516
+ // if (url.includes('error=')) {
517
+ // const error =
518
+ // new URL(url).searchParams.get('error_description') || 'Unknown error';
519
+ // onError(new Error(error));
520
+ // onClose();
521
+ // return false;
522
+ // }
523
+ // return true;
524
+ // };
525
+ // const handleLogoutNavigation = (event: WebViewNavigation) => {
526
+ // if (
527
+ // event.url.includes('/home') ||
528
+ // event.url.includes('/session_redirect') ||
529
+ // event.url.includes('login')
530
+ // ) {
531
+ // onLogout();
532
+ // onClose();
533
+ // }
534
+ // };
535
+ // if (!clientId || !redirectUri || !clientSecret) {
536
+ // if (!logout && isVisible) {
537
+ // console.warn(
538
+ // 'LinkedInModal: Missing required props (clientId, clientSecret, or redirectUri)',
539
+ // );
540
+ // return (
541
+ // <View>
542
+ // <Text style={styles.errorText}>
543
+ // Missing required props (clientId, clientSecret, or redirectUri)
544
+ // </Text>
545
+ // </View>
546
+ // );
547
+ // }
548
+ // }
549
+ // return (
550
+ // <Modal
551
+ // visible={isVisible}
552
+ // animationType={modalProps.animationType || 'slide'}
553
+ // onRequestClose={onClose}
554
+ // transparent={false}
555
+ // {...modalProps}
556
+ // >
557
+ // <SafeAreaView style={[styles.container, containerStyle]}>
558
+ // <View style={[styles.wrapper, wrapperStyle]}>
559
+ // {renderHeader ? (
560
+ // renderHeader({ onClose })
561
+ // ) : (
562
+ // <DefaultHeader onClose={onClose} />
563
+ // )}
564
+ // <View style={styles.webViewContainer}>
565
+ // {logout ? (
566
+ // <WebView
567
+ // source={{ uri: LINKEDIN_URLS.LOG_OUT }}
568
+ // style={styles.webView}
569
+ // javaScriptEnabled
570
+ // domStorageEnabled
571
+ // sharedCookiesEnabled
572
+ // thirdPartyCookiesEnabled
573
+ // onNavigationStateChange={handleLogoutNavigation}
574
+ // onLoadStart={() => setIsLoading(true)}
575
+ // onLoadEnd={() => setIsLoading(false)}
576
+ // />
577
+ // ) : (
578
+ // <WebView
579
+ // ref={webViewRef}
580
+ // source={{ uri: authUrl }}
581
+ // onShouldStartLoadWithRequest={handleNavigationStateChange}
582
+ // onLoadStart={() => setIsLoading(true)}
583
+ // onLoadEnd={() => setIsLoading(false)}
584
+ // onError={err => onError(new Error(err.nativeEvent.description))}
585
+ // style={styles.webView}
586
+ // javaScriptEnabled
587
+ // domStorageEnabled
588
+ // startInLoadingState={true}
589
+ // renderLoading={() => <View />} // Handled by our custom overlay
590
+ // />
591
+ // )}
592
+ // {isLoading &&
593
+ // (renderLoading ? renderLoading() : <DefaultLoading />)}
594
+ // </View>
595
+ // </View>
596
+ // </SafeAreaView>
597
+ // </Modal>
598
+ // );
599
+ // };
600
+ // const styles = StyleSheet.create({
601
+ // container: {
602
+ // flex: 1,
603
+ // backgroundColor: '#fff',
604
+ // },
605
+ // wrapper: {
606
+ // flex: 1,
607
+ // },
608
+ // webViewContainer: {
609
+ // flex: 1,
610
+ // position: 'relative',
611
+ // },
612
+ // webView: {
613
+ // flex: 1,
614
+ // },
615
+ // loadingOverlay: {
616
+ // ...StyleSheet.absoluteFillObject,
617
+ // justifyContent: 'center',
618
+ // alignItems: 'center',
619
+ // backgroundColor: 'rgba(255, 255, 255, 0.8)',
620
+ // zIndex: 1000,
621
+ // },
622
+ // defaultHeader: {
623
+ // height: 54,
624
+ // flexDirection: 'row',
625
+ // justifyContent: 'flex-end',
626
+ // alignItems: 'center',
627
+ // paddingHorizontal: 10,
628
+ // borderBottomWidth: 1,
629
+ // borderBottomColor: '#e0e0e0',
630
+ // backgroundColor: '#f8f8f8',
631
+ // },
632
+ // closeButton: {
633
+ // padding: 10,
634
+ // },
635
+ // closeButtonText: {
636
+ // fontSize: 24,
637
+ // color: '#333',
638
+ // fontWeight: 'bold',
639
+ // },
640
+ // errorText: {
641
+ // color: 'red',
642
+ // fontSize: 16,
643
+ // fontWeight: 'bold',
644
+ // textAlign: 'center',
645
+ // },
646
+ // });
647
+ // export default LinkedInModal;
4
648
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;AAC5D,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,EAGZ,MAAM,EACN,QAAQ,EACR,SAAS,GACV,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,IAAI,EAC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AyB;AACzB,0DAA0D;AAC1D,yCAAyC;AACzC,oCAAoC;AACpC,oCAAoC;AACpC,uCAAuC;AACvC,2CAA2C;AAC3C,mEAAmE;AACnE,yDAAyD;AACzD,wDAAwD;AACxD,mBAAmB;AACnB,oBAAoB;AACpB,yBAAyB;AACzB,mCAAmC;AACnC,4CAA4C;AAC5C,6EAA6E;AAC7E,yDAAyD;AACzD,wDAAwD;AACxD,mFAAmF;AACnF,yCAAyC;AACzC,oCAAoC;AACpC,oCAAoC;AACpC,6CAA6C;AAC7C,kFAAkF;AAClF,mBAAmB;AACnB,iBAAiB;AAEjB,4BAA4B;AAC5B,wEAAwE;AACxE,oBAAoB;AACpB,kBAAkB;AAClB,wBAAwB;AACxB,eAAe;AACf,OAAO;AACP,KAAK;AAEL,qCAAqC;AACrC,iBAAiB;AACjB,eAAe;AACf,+BAA+B;AAC/B,OAAO;AACP,eAAe;AACf,eAAe;AACf,OAAO;AACP,wBAAwB;AACxB,eAAe;AACf,4BAA4B;AAC5B,OAAO;AACP,eAAe;AACf,eAAe;AACf,OAAO;AACP,sBAAsB;AACtB,wCAAwC;AACxC,gCAAgC;AAChC,4BAA4B;AAC5B,mDAAmD;AACnD,oBAAoB;AACpB,OAAO;AACP,qBAAqB;AACrB,kBAAkB;AAClB,4BAA4B;AAC5B,kCAAkC;AAClC,4BAA4B;AAC5B,6BAA6B;AAC7B,4BAA4B;AAC5B,oCAAoC;AACpC,kCAAkC;AAClC,OAAO;AACP,mBAAmB;AACnB,mBAAmB;AACnB,OAAO;AACP,uBAAuB;AACvB,oBAAoB;AACpB,qBAAqB;AACrB,0BAA0B;AAC1B,OAAO;AACP,iBAAiB;AACjB,oBAAoB;AACpB,oBAAoB;AACpB,0BAA0B;AAC1B,2BAA2B;AAC3B,OAAO;AACP,MAAM;AAEN,gCAAgC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=setupTests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupTests.d.ts","sourceRoot":"","sources":["../src/setupTests.ts"],"names":[],"mappings":""}
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ jest.mock('react-native', () => {
3
+ const React = require('react');
4
+ const View = (props) => React.createElement('View', props, props.children);
5
+ const Text = (props) => React.createElement('Text', props, props.children);
6
+ const Modal = (props) => React.createElement('Modal', props, props.children);
7
+ const TouchableOpacity = (props) => React.createElement('TouchableOpacity', props, props.children);
8
+ const ActivityIndicator = (props) => React.createElement('ActivityIndicator', props, props.children);
9
+ const SafeAreaView = (props) => React.createElement('SafeAreaView', props, props.children);
10
+ return {
11
+ StyleSheet: {
12
+ create: (styles) => styles,
13
+ absoluteFillObject: {},
14
+ flatten: (style) => style,
15
+ },
16
+ View,
17
+ Text,
18
+ Modal,
19
+ TouchableOpacity,
20
+ ActivityIndicator,
21
+ SafeAreaView,
22
+ Platform: {
23
+ OS: 'ios',
24
+ select: (objs) => objs.ios,
25
+ },
26
+ Dimensions: {
27
+ get: () => ({ width: 375, height: 812 }),
28
+ },
29
+ __esModule: true,
30
+ };
31
+ });
32
+ jest.mock('react-native-webview', () => {
33
+ const React = require('react');
34
+ return {
35
+ __esModule: true,
36
+ default: (props) => React.createElement('View', { ...props, testID: 'mock-webview' }),
37
+ };
38
+ });
39
+ jest.mock('react-native-webview/lib/WebViewTypes', () => ({}));
40
+ //# sourceMappingURL=setupTests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupTests.js","sourceRoot":"","sources":["../src/setupTests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE;IAC7B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE/B,MAAM,IAAI,GAAG,CAAC,KAAU,EAAE,EAAE,CAC1B,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrD,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C,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACrC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B,OAAO;QACL,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,CAAC,KAAU,EAAE,EAAE,CACtB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;KACpE,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-linkedin-oauth2",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A simple package to integrate Linkedin OAuth2 in React Native Apps",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -51,6 +51,7 @@
51
51
  "@react-native/typescript-config": "0.83.0",
52
52
  "@testing-library/react-native": "^13.3.3",
53
53
  "@types/jest": "^29.5.13",
54
+ "@types/node": "^25.0.3",
54
55
  "@types/react": "^19.2.0",
55
56
  "@types/react-test-renderer": "^19.1.0",
56
57
  "eslint": "^8.19.0",
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- import { loginLinkedIn } from '../index.js';
2
- import { test, expect, vi } from 'vitest';
3
- test('Test loginLinkedIn function', () => {
4
- expect(loginLinkedIn).toBeDefined();
5
- const logSpy = vi.spyOn(console, 'log');
6
- loginLinkedIn();
7
- expect(logSpy).toHaveBeenCalledWith('Logging In In Your App Using Linkedin !!! ');
8
- logSpy.mockRestore();
9
- });
10
- //# sourceMappingURL=index.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE1C,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE;IACvC,MAAM,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,CAAC;IAEpC,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAExC,aAAa,EAAE,CAAC;IAEhB,MAAM,CAAC,MAAM,CAAC,CAAC,oBAAoB,CACjC,4CAA4C,CAC7C,CAAC;IAEF,MAAM,CAAC,WAAW,EAAE,CAAC;AACvB,CAAC,CAAC,CAAC"}