あらすじ
nux-auth と Auth0 で SSO(シングルサインオン)するプロジェクトに関わる事になったので試しに example を用意したんですが logout がうまくできない
起きている事
- logout を実行する
- 再度 login すると ID, PW の入力不要でログインできてしまう。
解決方法
ポイントは2点
- Auth0 の logout URL を直接叩く
- Auth0 の設定画面で
Allowed Logout URLsに logout 後に戻りたい URL を指定する
以下のようなコードを書いて
async logout() {
await this.$auth.logout()
window.location.href = "https://your-tenant.auth0.com/v2/logout?returnTo=http://localhost:3000"
}
それから以下のようにセッティングを追加すれば OK
