fix(auth): preserve backend roles on login

This commit is contained in:
zetaloop
2026-04-24 09:06:44 +08:00
parent ffb420f7e7
commit d59f7c6dc8
4 changed files with 22 additions and 18 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ export default function LoginPage() {
const onSubmit = async (data: z.infer<typeof loginSchema>) => {
try {
const user = await loginApi({ username: data.username, password: data.password })
storeLogin(user, ["consumer", "player", "owner"])
storeLogin(user, user.verifiedRoles)
router.push("/")
} catch (err) {
notifyInfo(toApiError(err).msg)