Account lifecycle

What happens to your application's grants, tokens and data when a user's email address is changed by onefold staff, they reset their password, remove your application, or their account is disabled and restored.

A user's account changes without your application being involved: onefold staff change its email address, the user resets their password or removes your application, or the account is taken out of service. This page says what each change does to your application's access, and which webhook tells you.

Summary

What happensYour tokensTheir grantYour metadataWebhook
The user changes their username or profileKeep workingStaysStaysprofile.updated
onefold staff change the email address on the accountStop workingEnds when the new address is confirmedSee belowprofile.disabled, then consent.revoked
The user confirms an email address that was not verifiedStop workingEndsSee belowconsent.revoked
The user resets their password through recovery, or has it set by the platform's operatorsStop workingEndsStaysconsent.revoked
The user removes your applicationStop workingEndsStaysconsent.revoked
The user moves to another email addressStop working for the previous subMoves with the userMoves with the usersubject.changed
onefold staff hold the accountRefused until the hold is releasedStaysStaysprofile.disabled, then profile.restored
The account is disabledStop workingEndsDeletedprofile.disabled, then consent.revoked

You can also end a grant yourself, from the application's Users tab. That has the same effect on your tokens as the user removing your application.

Email address changes

A user cannot change the email address on their account themselves. They ask the operator of the platform, and onefold staff change it. The new address is not verified: nobody has proven they can read it.

  • Applications that knew the user receive profile.disabled. No event carries the address; read email and email_verified from the management API or userinfo.
  • Your tokens for the account are refused from then on, and the user is signed out of onefold on every device.
  • The grant ends when the person confirms the new address. See Confirming the address.
  • sub does not change.

This is why you key users on sub. An application that matches users by email address loses track of a user whose address is changed.

A user moves to another email address

A user can move their profile in your organization to the account of another email address they control. An administrator of your organization can also ask for the move; the user's current address is told and can cancel it for seven days. Nothing about the user's sign-in methods or other organizations changes.

After a move, your application knows the user by the other account, so their sub changes:

  • You receive subject.changed with the old value in previous_sub and the new one in sub, followed by profile.succeeded, or by profile.merged when that account already had a profile in your organization.
  • Your tokens for the previous sub stop working.
  • The user keeps their access to your application. Their next sign-in to it shows the consent screen again.

Re-key what you store about the user from previous_sub to sub when subject.changed arrives. If you missed the event, a lookup by the previous sub answers with the user under the current one.

Password reset

A user who resets their password through Forgot password? is signed out of onefold everywhere, and every application's grant for that user ends. Your tokens for them stop working at once; a refresh answers invalid_grant.

Send the user through sign-in again. They approve your application again and you receive new tokens. Your metadata about them is unchanged.

The same is true when the platform's operators set a password for the account, which they do to recover one that may be in the wrong hands: the user is signed out everywhere, your grant ends, and you receive consent.revoked. A password changed on the Security page, with the current password entered, ends the account's other sessions and nothing else.

A user removes your application

A user can remove your application from their authorized applications at any time. The grant ends, your tokens stop working, and you receive consent.revoked.

The management API stops returning the user immediately. If they authorize your application again, they return with the same sub.

Account disabling

A user cannot delete their own account. They ask the operator of the platform, and onefold staff disable it. When an account is disabled:

  1. Applications the user had authorized receive profile.disabled.
  2. Every grant ends, every token stops working, and you receive consent.revoked.
  3. Your metadata about the user is deleted.

On profile.disabled followed by consent.revoked, delete or anonymize what your application holds about that sub.

Restoration

A disabled account comes back when its holder signs in again, with a password, a passkey or an emailed code and then their second factor if they have one. There is no time limit. A restored account keeps its sub, but it does not get its grants back: the user authorizes your application again, and the metadata that was deleted is not restored. You receive no event for the restoration; consent.granted tells you the user is back.

Do not treat a disabled account as reversible. If a user returns after their account was disabled, treat them as a returning user whose data you removed.

Accounts that can no longer sign in

onefold refuses tokens that belong to an account that is disabled or held, or whose email address is not verified. Userinfo answers 401 and a refresh answers invalid_grant, as for any revoked token.

When onefold takes an account out of service

onefold staff can hold an account, or mark its email address as not verified — which is also what happens when staff change the address on an account.

  • A held account. Your tokens for it are refused until staff release the hold, and the same tokens work again afterwards. You receive profile.disabled when the hold is placed and profile.restored when it is released.
  • An address marked as not verified. Applications that knew the user receive profile.disabled. Your tokens for the account are refused from then on, and the grant ends when the person confirms the address.

In both cases the person is signed out of onefold on every device.

Confirming the address

An account whose email address is not verified is confirmed by the person who owns the address. When that happens, every grant the account held ends: your tokens for it are revoked, not restored, and you receive consent.revoked. Send the user through sign-in again; they approve your application again and keep the same sub.

Your metadata about the user is deleted when the address had never been confirmed on that account, and kept when the account had been verified before.

What your application should do

  • Key every user on sub.
  • Treat a refused token as a signed-out user, and send them through sign-in.
  • Subscribe to consent.revoked, profile.disabled and subject.changed so that your own records follow.
  • Read email and email_verified when you need them, instead of storing them once.

On this page