({ user, account, profile })
| 636 | }), |
| 637 | DiscordProvider({ |
| 638 | clientId: DISCORD_OAUTH_CLIENT_ID ?? '', |
| 639 | clientSecret: DISCORD_OAUTH_CLIENT_SECRET ?? '', |
| 640 | }), |
| 641 | LinkedInProvider({ |
| 642 | clientId: LINKEDIN_CLIENT_ID, |
| 643 | clientSecret: LINKEDIN_CLIENT_SECRET, |
| 644 | issuer: 'https://www.linkedin.com/oauth', |
| 645 | wellKnown: 'https://www.linkedin.com/oauth/.well-known/openid-configuration', |
| 646 | client: { |
| 647 | token_endpoint_auth_method: 'client_secret_post', |
| 648 | }, |
| 649 | authorization: { |
| 650 | params: { |
| 651 | scope: 'openid profile email', |
| 652 | }, |
| 653 | }, |
| 654 | userinfo: { |
| 655 | // Use OpenID Connect userinfo endpoint instead of legacy REST API |
| 656 | url: 'https://api.linkedin.com/v2/userinfo', |
| 657 | }, |
| 658 | profile(profile) { |
| 659 | // LinkedIn OpenID Connect returns profile in this format |
| 660 | const email = profile.email || profile.email_address; |
| 661 | const name = parseLinkedInProfileName(profile); |
| 662 | const picture = profile.picture || profile.profile_picture; |
| 663 | |
| 664 | return { |
| 665 | id: profile.sub, |
| 666 | email: email, |
| 667 | name: name, |
| 668 | image: picture, |
| 669 | }; |
| 670 | }, |
| 671 | }), |
| 672 | WorkOSProvider({ |
| 673 | clientId: WORKOS_CLIENT_ID, |
| 674 | clientSecret: WORKOS_API_KEY, |
| 675 | client: { |
| 676 | token_endpoint_auth_method: 'client_secret_post', |
| 677 | }, |
| 678 | }), |
| 679 | // Email provider for magic link authentication using CredentialsProvider |
| 680 | // We use CredentialsProvider because EmailProvider requires a database adapter, |
| 681 | // but we're using JWT sessions without an adapter |
| 682 | CredentialsProvider({ |
| 683 | id: 'email', |
| 684 | name: 'Email', |
| 685 | credentials: { |
| 686 | token: { label: 'Token', type: 'text' }, |
| 687 | }, |
| 688 | async authorize(credentials) { |
| 689 | if (!credentials?.token) { |
| 690 | return null; |
| 691 | } |
| 692 | |
| 693 | const tokenData = await verifyAndConsumeMagicLinkToken(credentials.token); |
| 694 | |
| 695 | if (!tokenData) { |
no test coverage detected