fix authentication issue

This commit is contained in:
Sara
2023-11-01 14:52:20 +01:00
committed by Mathieu Virbel
parent 7ca152992c
commit 18c0d7a13b
3 changed files with 12 additions and 21 deletions

View File

@@ -30,9 +30,10 @@ export default function TranscriptDetails(details: TranscriptDetails) {
const topics = useTopics(api, transcriptId);
const waveform = useWaveform(api, transcriptId);
const useActiveTopic = useState<Topic | null>(null);
const requireLogin = featureEnabled("requireLogin");
useEffect(() => {
if (featureEnabled("requireLogin") && !isAuthenticated) return;
if (requireLogin && !isAuthenticated) return;
setTranscriptId(details.params.transcriptId);
}, [api]);

View File

@@ -62,24 +62,12 @@ export const getFiefAuth = async (url: URL) => {
export const getFiefAuthMiddleware = async (url) => {
const protectedPaths = [
{
matcher: "/:domain/transcripts",
parameters: {},
},
{
matcher: "/:domain/transcripts/:path*",
parameters: {},
},
{
matcher: "/:domain/browse",
parameters: {},
},
{
matcher: "/transcripts",
parameters: {},
},
{
matcher: "/transcripts/:path*",
matcher: "/transcripts/((?!new).*)",
parameters: {},
},
{