Created
July 2, 2021 09:33
-
-
Save enesozturk/1bb9c20b60da566fe20c79d2b26ef2e0 to your computer and use it in GitHub Desktop.
Revisions
-
enesozturk created this gist
Jul 2, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ 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;