feat: Add Import/export login token patch#836
Conversation
|
At the login page, I feel text could be something like Also are there any expiration dates for the extracted token. If there is, please mention that as well. |
Changed to
It appears there is no expiration date. |
|
Today I noticed that by putting my phone in airplane mode and then logging out, I could remove my account from the app without sending an logout request to the server. How stupid I was! I think I'll leave the "Force remove" function as is for now. |
Does the app work that way or the one you designed work like that ? If it's yours, why can't we check network status and then log out ( |
Important: This patch does NOT fix the login attestation problem.
This will allow you to log in with a token exported from a device you're already logged in to.
This is useful in the following cases:
Exported tokens can be imported from the login screen.
Also, I added the "Force remove account" setting.
It removes an account from the app without uninstalling the app, or logging out the session token.
It's necessary to remove account without revoking a token that has been imported to other devices.
How it works
X for Android stores the tokens and information of the currently logged-in account in the Android system's AccountManager.
This information continues to work even if you clear the app data.
(This is also why X still be logged in even after clearing the app data.)
Therefore, you can restore this information and log in on other devices.
Videos
export.mp4
import.mp4
An example of exported json
TODOs before it's ready
"Force remove account" sometimes doesn't works properly.The token is invalidated and the server is no longer accessible, but the automatic logout is not triggered. I'll address this in a later commit.Because piko strings are not translated in all languages. And app's text are hard to translate by users themselves. OTOH, if it's in Web, users can translate with their browsers.
Which is better? And when it comes to host outside, where should I place it? It can be repository's
/docsdir or GitHub Wiki.Add a confirm dialog before remove accountImprove restart experience