Skip to content

Commit

Permalink
Fix imports and success osm-teams login modal
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel committed Mar 21, 2023
1 parent 3405836 commit f015720
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/src/hooks/UseOSMTeams.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';

import { OSM_TEAMS_API_URL } from '../config';
import { fetchExternalJSONAPI } from '../network/genericJSONRequest';
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/views/authorized.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ export function OSMTeamsAuthorized(props) {
window.close();
return;
}
const session_token = params.get('access_token');
const refresh_token = params.get('refresh_token');
dispatch(setOSMTeamsDetails(session_token, refresh_token));
const sessionToken = params.get('access_token');
const refreshToken = params.get('refresh_token');
dispatch(setOSMTeamsDetails(sessionToken, refreshToken));
setIsReadyToRedirect(true);
const redirectUrl =
params.get('redirect_to')
? params.get('redirect_to')
? `${params.get('redirect_to')}?access_token=${params.get('access_token')}`
: '/manage/teams';
navigate(redirectUrl)
navigate(redirectUrl);
}, [dispatch, location.search, navigate]);

return <>{isReadyToRedirect ? null : <div>redirecting</div>}</>;
Expand Down

0 comments on commit f015720

Please sign in to comment.