我正在使用 auth0-jwt 来处理身份验证:
this.auth0.parseHash((err, authResult) => {
if (authResult && authResult.accessToken && authResult.idToken) {
window.location.hash = '';
this.setSession(authResult);
this.router.navigate(['/']);
} else if (err) {
this.router.navigate(['/']);
}
});
但是,虽然window.location.hash
包含 authResult:
#access_token=qwe&expires_in=7200&token_type=Bearer&state=zbc&id_token=xyz
,但auth0.parseHash
返回无效令牌并且authResult
未定义我正在使用:
"@auth0/angular-jwt": "^1.0.0-beta.9",
"auth0-js": "^9.2.2"