feat(auth): P0 登录与会话(迁移 v16、argon2id、HttpOnly Cookie)
- 迁移机制:schema::migrate 支持 15→16,新增 admin/session/setting 表 - 接口:session/setup/login/logout/password;SameSite=Strict + Origin 校验 + 失败限流 - 会话只存 token 的 sha256;改密清空全部会话 - 前端:/login 独立壳(首次=设置密码),页头登录/退出切换 - 测试:37 passed(迁移 + 登录/会话 4 例) - 文档:README 登录说明、docs/ADMIN-PLAN.md 方案与 P0 记录
This commit is contained in:
@@ -3,9 +3,15 @@ import { createRoot } from 'react-dom/client'
|
||||
import '@stash/ui/style.css'
|
||||
import './index.css'
|
||||
import App from './App.tsx'
|
||||
import { LoginPage } from './components/auth/LoginPage'
|
||||
|
||||
/**
|
||||
* 入口分流:登录页是独立壳(不挂 Layout / 侧栏 / 搜索),
|
||||
* 且必须在 App 的 `useViewRoute` 把地址规范化之前判定,
|
||||
* 所以放在这里用首次加载的 pathname 决定,而不是放进 App 里。
|
||||
*/
|
||||
const isLoginPage = window.location.pathname === '/login'
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
<StrictMode>{isLoginPage ? <LoginPage /> : <App />}</StrictMode>,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user