Skip to content

Commit

Permalink
Add support for redirectURL
Browse files Browse the repository at this point in the history
  • Loading branch information
Shreyaschorge committed Apr 23, 2024
1 parent 4686725 commit 22a7b79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion react-native-sign-in-with-neynar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@neynar/react-native-signin",
"version": "1.0.3",
"version": "1.1.0",
"keywords": [
"react-native",
"neynar",
Expand Down
7 changes: 6 additions & 1 deletion react-native-sign-in-with-neynar/src/NeynarSigninButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface IProps {
fetchAuthorizationUrl: () => Promise<string>;
successCallback: (data: ISuccessMessage) => void;
errorCallback?: (error: any) => void;
redirectUrl?: string;
theme?: Theme;
variant?: Variant;
height?: number;
Expand Down Expand Up @@ -78,6 +79,7 @@ export const NeynarSigninButton = ({
fetchAuthorizationUrl,
successCallback,
errorCallback = () => {},
redirectUrl,
theme = Theme.LIGHT,
variant = Variant.NEYNAR,
height,
Expand Down Expand Up @@ -107,7 +109,10 @@ export const NeynarSigninButton = ({

const handleOnPress = async () => {
try {
const authUrl = await fetchAuthorizationUrl();
let authUrl = await fetchAuthorizationUrl();
if (redirectUrl) {
authUrl = `${authUrl}&deeplink_url=${encodeURIComponent(redirectUrl)}`;
}
setAuthUrl(authUrl);
setModalVisible(true);
} catch (error) {
Expand Down

0 comments on commit 22a7b79

Please sign in to comment.