Skip to content

fix: unlink all OIDC providers when user updates email address#3307

Merged
Salazareo merged 1 commit into
HeyPuter:mainfrom
MrBobertus:fix-oidc-unlink-on-email-change
Jun 25, 2026
Merged

fix: unlink all OIDC providers when user updates email address#3307
Salazareo merged 1 commit into
HeyPuter:mainfrom
MrBobertus:fix-oidc-unlink-on-email-change

Conversation

@MrBobertus

Copy link
Copy Markdown
Contributor

Hey folks,

took a quick peek under the hood to patch that SSO backdoor we talked about. Since updating the primary email was leaving the old OIDC credentials hardwired to the user record i wired up a quick manual override on the database layer to cleanly sever the connection.

I've added a call to decouple all OIDC providers upon an email update
await this.stores.oidc.unlinkAllByUserId(user.id);

And implemented the corresponding query in the store to purge those old bindings from the table

async unlinkAllByUserId(userId: string): Promise<void> {
    await this.clients.db.write(
        'DELETE FROM `user_oidc_providers` WHERE `user_id` = ?',
        [userId],
    );
}

This properly cuts the cord on those old SSO keys and locks them out. Let me know if you need any calibration on this patch

@CLAassistant

CLAassistant commented Jun 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Salazareo Salazareo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks for the contribution!

@Salazareo Salazareo merged commit c98e293 into HeyPuter:main Jun 25, 2026
4 checks passed
@MrBobertus MrBobertus deleted the fix-oidc-unlink-on-email-change branch June 26, 2026 09:18
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.

3 participants