Skip to content

Auth: Handle invalid account #2865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

DaVinci9196
Copy link
Contributor

@DaVinci9196 DaVinci9196 commented Apr 22, 2025

#2731 (comment)
Based on @fynngodau’s solution, use notifications to inform users whether their account has expired. Users can choose to log in again or log out.
Choosing to re-login will be handled based on the newly added reauth interface.

@lucasmz-dev
Copy link
Contributor

Nice! Great to see this fixed 😭😭😭

Copy link
Member

@fynngodau fynngodau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for implementing this feature. However, as a regression, the UserSatisfyRequirements resolution feature no longer works with these changes.

Comment on lines 46 to 49
<string name="auth_action_reauth_notification_title">Account issue detected</string>
<string name="auth_action_reauth_notification_content">There is an issue with your account (%1$s). Please perform relevant actions.</string>
<string name="auth_action_reauth_notification_re_login">Log in again</string>
<string name="auth_action_reauth_notification_remove_account">Remove account</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my personal perspective on UX, the notification content should be very short (on my screen the last few words are cropped off). To achieve this, I would not include the email address again as it is already shown in the notification subtext. Additionally, rather than "issue detected", I would use something more actionable (the other type of notification uses "Account action required", which could fit here as well). "Relevant actions" is also not very specific – are there cases where the flow will do anything other than ask for user's credentials?

If I remember correctly, the notification Google Play services uses talks about "entering your password again". I propose the following texts:

Suggested change
<string name="auth_action_reauth_notification_title">Account issue detected</string>
<string name="auth_action_reauth_notification_content">There is an issue with your account (%1$s). Please perform relevant actions.</string>
<string name="auth_action_reauth_notification_re_login">Log in again</string>
<string name="auth_action_reauth_notification_remove_account">Remove account</string>
<string name="auth_action_reauth_notification_title">Signed out of account</string>
<string name="auth_action_reauth_notification_content">Please sign in again to keep using your account.</string>
<string name="auth_action_reauth_notification_re_login">Sign in again</string>
<string name="auth_action_reauth_notification_remove_account">Remove account</string>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary to remind users which account is invalid, as different apps will use different accounts. However, the reminder text has been simplified.

@fynngodau
Copy link
Member

One thing I noticed is that reauth is not possible if Android ID has changed (i.e. when microG data has been deleted, but accounts were kept). This should be relatively easy to fix, but I don't think it needs to be solved in this PR. 🙂

@fynngodau
Copy link
Member

When testing this PR, I removed some specific devices from the Security tab in myaccount. A few days later, unrelated to this PR, I was not able to sign in (or reauth) from microG until I changed Android ID; perhaps the device was locked out in a way microG is unable to recover from? The server response was only a generic error.

Copy link
Member

@fynngodau fynngodau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements. Reauth and enterprise setup both work at the same time now. 👍

I'm not entirely happy with the UI choices made for the notification, but that's for @mar-v-in to decide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

microG does not behave gracefully with invalid sessions of Google accounts
5 participants