mirror of
https://gitee.com/wanwujie/sub2api-mobile
synced 2026-04-21 07:14:46 +08:00
fix: require live admin key on web auth gating
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { Redirect, Tabs } from 'expo-router';
|
||||
import { ChartNoAxesCombined, Settings2, Users } from 'lucide-react-native';
|
||||
|
||||
import { adminConfigState } from '@/src/store/admin-config';
|
||||
import { adminConfigState, hasAuthenticatedAdminSession } from '@/src/store/admin-config';
|
||||
|
||||
const { useSnapshot } = require('valtio/react');
|
||||
|
||||
export default function TabsLayout() {
|
||||
const config = useSnapshot(adminConfigState);
|
||||
const hasAccount = Boolean(config.baseUrl.trim());
|
||||
const hasAccount = hasAuthenticatedAdminSession(config);
|
||||
|
||||
if (!hasAccount) {
|
||||
return <Redirect href="/login" />;
|
||||
|
||||
Reference in New Issue
Block a user