Skip to content

Commit

Permalink
login issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hassanad94 committed Oct 26, 2023
1 parent 56f2878 commit 9748708
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { useEffect } from "react";

export const NotAuthenticatedOverride = () => {
useEffect(() => {
console.log("Redirecting");
window.location.replace("/");
}, []);

return null;
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Repository } from "@sensenet/client-core";
import { RepositoryContext } from "@sensenet/hooks-react";
import { configuration, repositoryUrl } from "../../utils/configurations";
import { BrowserRouter, useLocation, useNavigate } from "react-router-dom";
import { NotAuthenticatedOverride } from "../auth/NotAutheticated";

type contextProps = {
children: ReactNode;
Expand All @@ -31,7 +32,11 @@ export const AuthProvider = ({ children }: contextProps) => {
push: navigate,
};
return (
<AuthenticationProvider configuration={configuration} history={history}>
<AuthenticationProvider
notAuthenticated={() => <NotAuthenticatedOverride />}
configuration={configuration}
history={history}
>
{children}
</AuthenticationProvider>
);
Expand Down
2 changes: 1 addition & 1 deletion src/parking-place/react-app/src/utils/configurations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const repositoryUrl = "https://sampleapps.test.sensenet.cloud";
export const configuration = {
client_id: "TdDZR9am6OVoYQgZ", // clientID of your repository
automaticSilentRenew: true,
redirect_uri: `${window.location.origin}/authentication/callback`,
redirect_uri: `${window.location.origin}/authentication/login_callback`,
response_type: "code",
post_logout_redirect_uri: `${window.location.origin}/`,
scope: "openid profile sensenet",
Expand Down

0 comments on commit 9748708

Please sign in to comment.