{"action":"created","issue":{"url":"https://api.github.com/repos/NIFTYCloud-mbaas/UserCommunity/issues/465","repository_url":"https://api.github.com/repos/NIFTYCloud-mbaas/UserCommunity","labels_url":"https://api.github.com/repos/NIFTYCloud-mbaas/UserCommunity/issues/465/labels{/name}","comments_url":"https://api.github.com/repos/NIFTYCloud-mbaas/UserCommunity/issues/465/comments","events_url":"https://api.github.com/repos/NIFTYCloud-mbaas/UserCommunity/issues/465/events","html_url":"https://github.com/NIFTYCloud-mbaas/UserCommunity/issues/465","id":158653582,"number":465,"title":"ユーザーのログアウト処理と削除を行う方法について","user":{"login":"dwomy","id":4175721,"avatar_url":"https://avatars.githubusercontent.com/u/4175721?v=3","gravatar_id":"","url":"https://api.github.com/users/dwomy","html_url":"https://github.com/dwomy","followers_url":"https://api.github.com/users/dwomy/followers","following_url":"https://api.github.com/users/dwomy/following{/other_user}","gists_url":"https://api.github.com/users/dwomy/gists{/gist_id}","starred_url":"https://api.github.com/users/dwomy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwomy/subscriptions","organizations_url":"https://api.github.com/users/dwomy/orgs","repos_url":"https://api.github.com/users/dwomy/repos","events_url":"https://api.github.com/users/dwomy/events{/privacy}","received_events_url":"https://api.github.com/users/dwomy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-06T11:11:50Z","updated_at":"2016-06-06T11:23:17Z","closed_at":null,"body":"お世話になっております。\r\n\r\n現在、javascriptにてログイン中の会員が退会に進んだ際に以下のような処理を記述しておりました。\r\n\r\n```\r\n// 1. ログインしていたユーザー(user)クラスの削除\r\nuser.delete();\r\n\r\n// 2. セッションのクリアの為ログアウト\r\nncmb.User.logout();\r\n```\r\n\r\nですが、上記では1と2の手順をどちらを先に行っても後に行ったほうが401となってしまいます。\r\n（たまに成功することもありますが、挙動としては成功する方がおかしい？）\r\n\r\nログアウトとユーザー削除を同時に行う、もしくはリクエストを送らずにログアウトする事はできないのでしょうか？\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NIFTYCloud-mbaas/UserCommunity/issues/comments/223932366","html_url":"https://github.com/NIFTYCloud-mbaas/UserCommunity/issues/465#issuecomment-223932366","issue_url":"https://api.github.com/repos/NIFTYCloud-mbaas/UserCommunity/issues/465","id":223932366,"user":{"login":"moongift","id":5709,"avatar_url":"https://avatars.githubusercontent.com/u/5709?v=3","gravatar_id":"","url":"https://api.github.com/users/moongift","html_url":"https://github.com/moongift","followers_url":"https://api.github.com/users/moongift/followers","following_url":"https://api.github.com/users/moongift/following{/other_user}","gists_url":"https://api.github.com/users/moongift/gists{/gist_id}","starred_url":"https://api.github.com/users/moongift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moongift/subscriptions","organizations_url":"https://api.github.com/users/moongift/orgs","repos_url":"https://api.github.com/users/moongift/repos","events_url":"https://api.github.com/users/moongift/events{/privacy}","received_events_url":"https://api.github.com/users/moongift/received_events","type":"User","site_admin":false},"created_at":"2016-06-06T11:23:17Z","updated_at":"2016-06-06T11:23:17Z","body":"ログアウト処理自体は `ncmb.User.logout();` なのですが、Web APIも叩いています。\r\n\r\nhttps://github.com/NIFTYCloud-mbaas/ncmb_js/blob/master/lib/user.js#L779\r\n\r\nで、すでにユーザがいないとこの処理が失敗しているのだと思います。かといって、ログアウト処理を行った後だと、user.deleteができない（権限がない）状態になるはずです。\r\n\r\n処理的にはlocalStorageの\r\n\r\nNCMB/APPLICATION_KEY/currentUser\r\n\r\nを削除して、ncmb.sessionToken = null としてあげればログイン状態は解除されます。APPLICATION_KEYはNCMBで取得されるものです。\r\n\r\n\r\n"}}
{"actor":{"display_login":"moongift"}}