登录强制刷新以刷新用户权限
This commit is contained in:
@@ -248,7 +248,7 @@ function LoginPageClient() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const redirect = searchParams.get('redirect') || '/';
|
const redirect = searchParams.get('redirect') || '/';
|
||||||
router.replace(redirect);
|
window.location.replace(redirect);
|
||||||
} else {
|
} else {
|
||||||
// 登录失败,重置Turnstile
|
// 登录失败,重置Turnstile
|
||||||
if (siteConfig?.LoginRequireTurnstile && turnstileWidgetId !== null && (window as any).turnstile) {
|
if (siteConfig?.LoginRequireTurnstile && turnstileWidgetId !== null && (window as any).turnstile) {
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ function OIDCRegisterPageClient() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
// 注册成功,跳转到首页
|
// 注册成功,接口已写入认证 cookie,这里用整页跳转确保权限配置和登录态完全重建
|
||||||
router.replace('/');
|
window.location.replace('/');
|
||||||
} else {
|
} else {
|
||||||
const data = await res.json().catch(() => ({}));
|
const data = await res.json().catch(() => ({}));
|
||||||
setError(data.error || '注册失败');
|
setError(data.error || '注册失败');
|
||||||
|
|||||||
Reference in New Issue
Block a user