migrate brapi token management to accountmanager#1412
Conversation
|
Other apps call: |
kamathprasad9
left a comment
There was a problem hiding this comment.
This works great!
If the user tries to login using two different accounts for the same server, the most recent token is saved - and I expect the workflow to be this way.
In addition to the changes mentioned, the BrapiAccountHelper and BrapiAuthenticator can be migrated to phenolib in the future. But regardless, this is working as intended
| import com.fieldbook.tracker.brapi.BrapiAuthenticator | ||
| import com.fieldbook.tracker.preferences.PreferenceKeys | ||
|
|
||
| object BrapiAccountHelper { |
There was a problem hiding this comment.
(these exact changes will only work from within the Field Book repository. to migrate to phenolib, might need to write it in a bit different way)
This works, but can instead write it something like
@Singleton
class BrAPIAccountManagerUtil @Inject constructor(
@ApplicationContext private val context: Context,
private val preferences: SharedPreferences,
) {That way, you can also use the preferences within this class instead of having to create the object every time.
Usage in other places
@Inject
BrAPIAccountManagerUtil accountManagerUtil;|
First, it seems credential manager is the modern approach to account management; although it seems this would require users to have a google account. After reviewing the documentation for account manager, I think we are doing a few things incorrectly.
|
|
I like the new compose UI
|
Description
Closes #205
Change Type
ADDITION(non-breaking change that adds functionality)CHANGE(fix or feature that alters existing functionality)FIX(non-breaking change that resolves an issue)OTHER(use only for changes like tooling, build system, CI, docs, etc.)Release Note