Steem Connect : access_tokenの保存先
こんにちは、 @shogoです。
Steemアプリケーションをつくる際、Steem Connectでのログインを実装することは必須だと思います。
基本的なことはSteem Developer Portalに書いてあるのですが、access_tokenの取り扱いについてはあまり詳しく書かれていませんでした。
Steem Connectでログインすると、このような感じでaccess_tokenやusernameが帰ってきます。
これをどこかに保存しておかないと、毎回ログインが必要になり、URLの見栄えもよくないです。
CookieかlocalStorageのどちらに保存するのが良いのか迷っていたのですが、色々調べてみるとlocalStorageの方が良さそうです。
localStorage.setItem('sc_token', token);
localStorage.getItem('sc_token');
localStorage.removeItem('sc_token');
Steem ConnectのDemoもとても参考になりました。
Steem関連の開発情報は少なく英語のみなので、今後は簡単なことでも記事にしていきたいと思います ;)
またSteem Keychainでのログインも試してみたいと思います。
Steem On,
@shogo
Dear shogo:
We are SteemBet, the next generation STEEM based gaming platform. We are honored to invite you to join our first fantastic dice game, which is just the beginning of SteemBet game series. Our dividend system has now launched. The prize pool has already accumulated 2,000 STEEM and more than 60 players have participated in staking mining token SBT. A huge reward of 40,000 STEEM is awaiting! Join us NOW with other 500 STEEM users to loot HUGE dividend reward!!
SteemBet Team
Official Website
https://steem-bet.com
Discord Server
https://discord.gg/95cBN3W
Telegram Group
https://t.me/steembet