developers
JWT & QR Auth5 min read
身份认证、移动端 JWT 刷新与 QR 扫码登录协议
Web 端使用 NextAuth 会话 Cookie,原生移动端/桌面端采用 Bearer JWT 访问令牌与轮换刷新(`/api/mobile/login`、`/api/mobile/refresh`),同时支持免密扫码登录(`/api/auth/qr/generate`)。
Key Capabilities & Takeaways
- 客户端拦截器内置 401 单飞刷新队列,避免并发请求重复触发令牌刷新。
原生客户端 Bearer JWT 登录与刷新示例
原生客户端向 `POST /api/mobile/login` 提交凭据获取 `access_token` 与 `refresh_token`,后续请求携带 `Authorization: Bearer <access_token>`,过期后调用 `POST /api/mobile/refresh` 换取新令牌。
const res = await fetch('https://app.inzorasuite.com/api/mobile/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, password }),
});
const { access_token, refresh_token } = await res.json();API Sandbox
Execute allowlisted public IBS endpoints live · Zero credentials required
Was this handbook guide helpful?