🛂(frontend) redirect to the OIDC when private doc
We now redirect to the OIDC when a user is on a private doc and get a 401 error.
This commit is contained in:
@@ -32,7 +32,7 @@ interface DocProps {
|
||||
}
|
||||
|
||||
const DocPage = ({ id }: DocProps) => {
|
||||
const { authenticated, login } = useAuthStore();
|
||||
const { login } = useAuthStore();
|
||||
const { data: docQuery, isError, error } = useDoc({ id });
|
||||
const [doc, setDoc] = useState(docQuery);
|
||||
|
||||
@@ -60,7 +60,7 @@ const DocPage = ({ id }: DocProps) => {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (error.status === 401 && !authenticated) {
|
||||
if (error.status === 401) {
|
||||
login();
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user