titanscouting / red-alliance-mobile

Red Alliance App in React
2 stars 6 forks source link

Frequent sign-in prompts #198

Open funblaster22 opened 1 year ago

funblaster22 commented 1 year ago

I'll take a look at this. It seems there might be logic missing to check if you're already logged-in, or not using refresh tokens

devksingh4 commented 1 year ago

The refresh token functionality seems to be broken in react-native-google-auth. Please reopen the PR if you can validate it to be working now - it's possible its been fixed in new versions. It does work correctly on iOS usually. Tokens expire either every 60min or 90min, don't remember which. We had issues during last comp where an expired token would result in lost scouting data, so getting rid of that forced auth would require extensive testing.

If we implement this we also would need to implement a "Switch User" setting.

devksingh4 commented 1 year ago

You should be able to implement refresh tokens with this comment: https://github.com/react-native-google-signin/google-signin/issues/425#issuecomment-613312390. So we would need to create an API route on TRA API to use the CLIENT_ID and CLIENT_SECRET that we would store on API to refresh the token. I believe I just didn't want to mess around with it before comp so if you can get it working that would be great, but I would call it medium priority.