JavaScript is required to use Bungie.net

#Bungie

originally posted in:BungieNetPlatform
4/3/2016 3:53:38 PM
2

How to handle token expiration?

Hi, i'm wondering how other people is handling token expiration on their apps. I used to base mine on when you get the Need Sign In error back in the call, but, all the PUBLIC end points don't behave like that, if you are logged in they return more info than when you are not logged in, but no error is present. I talked with VThron a few months back and he said that if you check the cookies on the response and the bungle token is not set as a cookie then you need to log in, but, i see that some end points like "User/GetBungieNetUser/" and "User/GetMembershipIds" don't have the cookies set on the response, so, after i log in it tells me i need to log in again, because no cookie is set. Are you guys hardcoding that only checks for other end points or is there a better way of doing this.
English
#Bungie

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

View Entire Topic
  • Edited by Spartain: 4/4/2016 3:04:00 AM
    If you want to handle at app start, you can make a request to Platform/User/GetBungieNetUser/, which is authenticated only, so you'll get an error. I use some data from there anyhow, so it doesn't impact my load times. Additionally, I have my app check for the 99-auth error after each request, and if there was a problem, it brings them back to the login page. I do like lowlines' solution, though in reality, each method should work equally. Just depends on whether you want to rely on saved caches or not. Edit: Cases where lowlines' solution would be better is refreshing and such. Mine would only throw on transfer/equip requests.

    Posting in language:

     

    Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

    1 Reply
    You are not allowed to view this content.
    ;
    preload icon
    preload icon
    preload icon