fix(auth): only guard Live tab, messages & dashboard are public
Auth overlay only shows when accessing Voice & Media without authentication. Messages panel and Dashboard panel remain fully accessible without login.
This commit is contained in:
@@ -31,13 +31,6 @@ export default function App() {
|
|||||||
setAuthenticated(true);
|
setAuthenticated(true);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// If not authenticated, show the auth overlay
|
|
||||||
if (!authenticated) {
|
|
||||||
const isPublicDashboard = import.meta.env.VITE_DASHBOARD_IS_PUBLIC === "true";
|
|
||||||
if (!isPublicDashboard) {
|
|
||||||
return <AuthOverlay onAuthenticated={handleAuthenticated} />;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const voice = useVoiceControl();
|
const voice = useVoiceControl();
|
||||||
const media = useMediaControl();
|
const media = useMediaControl();
|
||||||
const messages = useMessages();
|
const messages = useMessages();
|
||||||
@@ -48,6 +41,7 @@ export default function App() {
|
|||||||
|
|
||||||
const audio = useAudioPlayback();
|
const audio = useAudioPlayback();
|
||||||
const activeTab = uiState.activeTab || "messages";
|
const activeTab = uiState.activeTab || "messages";
|
||||||
|
const isPublicDashboard = import.meta.env.VITE_DASHBOARD_IS_PUBLIC === "true";
|
||||||
const selectedVoiceGuild =
|
const selectedVoiceGuild =
|
||||||
uiState.selectedVoiceGuild || uiState.selectedGuild || "";
|
uiState.selectedVoiceGuild || uiState.selectedGuild || "";
|
||||||
|
|
||||||
@@ -237,7 +231,9 @@ export default function App() {
|
|||||||
uiState.selectedTextChannel || uiState.selectedVoiceChannel || undefined
|
uiState.selectedTextChannel || uiState.selectedVoiceChannel || undefined
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{activeTab === "live" ? (
|
{activeTab === "live" && !authenticated && !isPublicDashboard ? (
|
||||||
|
<AuthOverlay onAuthenticated={handleAuthenticated} />
|
||||||
|
) : activeTab === "live" ? (
|
||||||
<LivePanel
|
<LivePanel
|
||||||
guilds={voice.guilds}
|
guilds={voice.guilds}
|
||||||
voiceChannels={voice.voiceChannels}
|
voiceChannels={voice.voiceChannels}
|
||||||
|
|||||||
Reference in New Issue
Block a user