dropbox / dropbox/SwiftyDropbox

Unhandled error when storing access token in OAuthImpl

Open
#443 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
721
Forks
218
PR merge metrics
No merged PRs in 30d

Description

Our users have been reporting issues where they keep getting signed out of Dropbox after quitting the app and relaunching.
This is how we're doing our setup and auth:
1. on app launch, `DropboxClientsManager.setupWithAppKey(.apiKey)` is called
2. sign in using `DropboxClientsManager.authorizeFromControllerV2`
3. call `DropboxClientsManager.handleRedirectURL`
4. now DropboxClientsManager.authorizedClient is not nil.
5. on next app launch, we call `DropboxClientsManager.setupWithAppKey(.apiKey)` again, but `DropboxClientsManager.authorizedClient` is still nil for some users.

after further digging into `handleRedirectURL` call, I [found this line](https://github.com/dropbox/SwiftyDropbox/blob/ce29a217890382615934425f0696b02839cbacbe/Source/SwiftyDropbox/Shared/Handwritten/OAuth/OAuthImpl.swift#L90) where result of `storeAccessToken` is ignored. In the case of `storeAccessToken` returns false, the access token is not persisted for next app launch.
This could mean that for those problematic users, after calling `DropboxClientsManager.setupWithAppKey(.apiKey)`, it may fail to setup authorizedClient in [this line](https://github.com/dropbox/SwiftyDropbox/blob/ce29a217890382615934425f0696b02839cbacbe/Source/SwiftyDropbox/Shared/Handwritten/DropboxClientsManager.swift#L59).
I can't verify this though or inform users why it fails since there's no logging visible from my app. Could someone help?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.