How pleb.school handles multi-provider login, Nostr-first identity, and account linking.

pleb.school supports Nostr-first and OAuth-first accounts with a unified identity model.
Nostr-first accounts use the Nostr profile as the source of truth and authenticate via NIP-98 signed events.
OAuth-first accounts use platform profile data and receive a server-managed Nostr keypair for protocol access. Keys are encrypted at rest.
Users can link Nostr, GitHub, and email into one account. Linking Nostr upgrades the profile source to Nostr-first and syncs profile data from relays.
Auth providers are configured in config/auth.json. GitHub requires client id and secret environment variables.
This system lets you reduce onboarding friction while preserving self-custody for Nostr-native users.