Skip to content

Instantly share code, notes, and snippets.

@enesozturk
Created July 2, 2021 09:33
Show Gist options
  • Save enesozturk/1bb9c20b60da566fe20c79d2b26ef2e0 to your computer and use it in GitHub Desktop.
Save enesozturk/1bb9c20b60da566fe20c79d2b26ef2e0 to your computer and use it in GitHub Desktop.
Single Sign On Callback Screen
import {useEffect} from 'react';
import {useNavigation} from '@react-navigation/native';
import {useDispatch} from 'react-redux';
import {handleAuthenticateViaCognito} from 'actions';
function SingleSignOnCallback({route}) {
const {goBack} = useNavigation();
const {id_token, authType} = route.params;
const dispatch = useDispatch();
useEffect(() => {
dispatch(
handleAuthenticateViaCognito(id_token, authType, () => {
goBack();
}),
);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return null;
}
export default SingleSignOnCallback;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment