后端对接:认证与角色权限接口需求 #5

Closed
opened 2026-10-15 21:30:00 +08:00 by saint · 1 comment
Owner

前端认证模块已推送 main(commit 460f120)。请实现并注册:POST /api/auth/register、POST /api/auth/login、POST /api/auth/logout、GET /api/auth/me、PATCH /api/users/me、POST /api/auth/change-password、GET /api/admin/users。注册端不得接收角色字段,只能创建 user;管理员接口和知识库/来源/实验等受限接口必须由后端校验 admin 角色。建议使用 HttpOnly、Secure、SameSite Cookie 会话,并提供 CSRF 防护。接口字段和前端待接入条件见 docs/AUTH_API_REQUIREMENTS.md。当前前端不会伪造登录或管理员身份。

前端认证模块已推送 main(commit 460f120)。请实现并注册:POST /api/auth/register、POST /api/auth/login、POST /api/auth/logout、GET /api/auth/me、PATCH /api/users/me、POST /api/auth/change-password、GET /api/admin/users。注册端不得接收角色字段,只能创建 user;管理员接口和知识库/来源/实验等受限接口必须由后端校验 admin 角色。建议使用 HttpOnly、Secure、SameSite Cookie 会话,并提供 CSRF 防护。接口字段和前端待接入条件见 docs/AUTH_API_REQUIREMENTS.md。当前前端不会伪造登录或管理员身份。
Author
Owner

Completed: authentication and role-protected endpoints are implemented. Closing this tracking issue. No sensitive data is included.

Completed: authentication and role-protected endpoints are implemented. Closing this tracking issue. No sensitive data is included.
saint closed this issue 2026-10-19 22:33:40 +08:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: saint/border-red-post-nalati#5