问题描述
使用 React18 组件,调用 authenticationClient.refreshToken() 时报错:
{
"code": 1001,
"message": "无权限执行此项操作"
}
但我不知道在哪配置权限,刷新 token 也需要权限?
重现步骤
- 运行下方代码
import { useEffect } from 'react';
import { GuardProvider, useGuard, User } from '@authing/guard-react18';
import '@authing/guard-react18/dist/esm/guard.min.css';
const GuardComponent = () => {
const guard = useGuard();
useEffect(() => {
guard.start('#authing-guard-container').then(async (userInfo: User) => {
const authenticationClient = await guard.getAuthClient();
await authenticationClient.refreshToken(); // 这一步报错
});
}, []);
return (
<div>
<div id="authing-guard-container" />
</div>
);
};
export default () => {
return (
<GuardProvider appId="65087fc919c6f5b08513cb53">
<GuardComponent />
</GuardProvider>
);
};
- 输入账号密码,登录后控制台报错:
{
"code": 1001,
"message": "无权限执行此项操作"
}
附加信息
- Version:
- Platform: