Skip to content

Commit

Permalink
Fix redirect loop on login with external provider
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofzuraw authored Jun 6, 2023
1 parent 5e6d128 commit 455602c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/auth/components/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface LoginCardProps {
onSubmit?: (event: LoginFormData) => SubmitPromise;
}

const LoginCard: React.FC<LoginCardProps> = props => {
const LoginPage: React.FC<LoginCardProps> = props => {
const {
errors,
disabled,
Expand Down Expand Up @@ -179,5 +179,5 @@ const LoginCard: React.FC<LoginCardProps> = props => {
</LoginForm>
);
};
LoginCard.displayName = "LoginCard";
export default LoginCard;
LoginPage.displayName = "LoginPage";
export default LoginPage;
8 changes: 3 additions & 5 deletions src/auth/views/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ const LoginView: React.FC<LoginViewProps> = ({ params }) => {
};

const handleExternalAuthentication = async (code: string, state: string) => {
const result = await loginByExternalPlugin(requestedExternalPluginId, {
await loginByExternalPlugin(requestedExternalPluginId, {
code,
state,
});
setRequestedExternalPluginId(null);
if (result && !result?.errors?.length) {
navigate(fallbackUri);
setFallbackUri(null);
}
navigate(fallbackUri);
setFallbackUri(null);
};

useEffect(() => {
Expand Down

0 comments on commit 455602c

Please sign in to comment.