Skip to content

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Sep 4, 2025

This is a preparation for expiring authentication tokens.

If we make authentication token expire,
we need to generate new authentication tokens each time QR code screen is opened in the UI,
so authentication token is fresh.
We however don't want to completely invalidate
old authentication codes at the same time,
e.g. they should still be valid for joining groups, just not result in a verification on the inviter side.

Since a group now can have a lot of authentication tokens, it is easy to lose track of them
without any way to remove them
as they are not displayed anywhere in the UI.
As a solution, we now remove all
tokens corresponding to a group ID
when one token is withdrawn,
or all non-group tokens
when a single non-group token is withdrawn.

"Reset QR code" option already present
in the UI which works by resetting
current QR code will work without any UI changes,
but will now result in invalidation
of all previously created QR codes and invite links.

@link2xt link2xt requested review from r10s, Hocuri and iequidoo September 4, 2025 17:38
@link2xt
Copy link
Collaborator Author

link2xt commented Sep 4, 2025

This is needed for #7140

Most users likely don't know anyway that they can reset individual QR codes by scanning their own QR codes. Original idea was that you can print QR codes and then enable/disable them separately, but there is no overview of it anyway and this is not how invite links work in other messengers where there is usually only one invite link and it is even shared between all members so one inviter resetting a link invalidates it for everyone.

I also thought about getting rid of withdrawing QR codes completely and having a dedicated "reset invite link" API, but the advantage of the solution in this PR is that no UI changes are needed.

@link2xt link2xt marked this pull request as draft September 4, 2025 18:04
@link2xt link2xt marked this pull request as ready for review September 4, 2025 18:04
@link2xt link2xt force-pushed the link2xt/rxxzowrsykzw branch from f5cb0f5 to fc6b510 Compare September 4, 2025 18:46
@link2xt
Copy link
Collaborator Author

link2xt commented Sep 4, 2025

Added some test.

@link2xt link2xt force-pushed the link2xt/rxxzowrsykzw branch from ae89dcc to 61ba228 Compare September 7, 2025 18:10
This is a preparation for expiring authentication tokens.

If we make authentication token expire,
we need to generate new authentication tokens each time
QR code screen is opened in the UI,
so authentication token is fresh.
We however don't want to completely invalidate
old authentication codes at the same time,
e.g. they should still be valid for joining groups,
just not result in a verification on the inviter side.

Since a group now can have a lot of authentication tokens,
it is easy to lose track of them
without any way to remove them
as they are not displayed anywhere in the UI.
As a solution, we now remove all
tokens corresponding to a group ID
when one token is withdrawn,
or all non-group tokens
when a single non-group token is withdrawn.

"Reset QR code" option already present
in the UI which works by resetting
current QR code will work without any UI changes,
but will now result in invalidation
of all previously created QR codes and invite links.
@link2xt link2xt force-pushed the link2xt/rxxzowrsykzw branch from 61ba228 to d89a9e2 Compare September 8, 2025 03:34
@link2xt link2xt merged commit 307a2eb into main Sep 8, 2025
29 checks passed
@link2xt link2xt deleted the link2xt/rxxzowrsykzw branch September 8, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants