答案 0 :(得分:0)
您需要在令牌过期前刷新令牌。查看文档 here (if you're using Code Flow) 或 here (if you're using implicit flow)
在您的 fun triggerRestart(context: Activity) {
val intent = Intent(context, MainActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(intent)
if (context is Activity) {
(context as Activity).finish()
}
Runtime.getRuntime().exit(0)
}
文件中,您还可以尝试在配置 oAuthService 后(调用 app.component.ts
后)订阅“token_expires”事件
this.oauthService.loadDiscoveryDocumentAndTryLogin();