|
| 1 | +import NextAuth from "next-auth" |
| 2 | + |
| 3 | +// import Apple from "next-auth/providers/apple" |
| 4 | +// import Atlassian from "next-auth/providers/atlassian" |
| 5 | +// import Auth0 from "next-auth/providers/auth0" |
| 6 | +// import Authentik from "next-auth/providers/authentik" |
| 7 | +// import AzureAD from "next-auth/providers/azure-ad" |
| 8 | +// import AzureB2C from "next-auth/providers/azure-ad-b2c" |
| 9 | +// import Battlenet from "next-auth/providers/battlenet" |
| 10 | +// import Box from "next-auth/providers/box" |
| 11 | +// import BoxyHQSAML from "next-auth/providers/boxyhq-saml" |
| 12 | +// import Bungie from "next-auth/providers/bungie" |
| 13 | +// import Cognito from "next-auth/providers/cognito" |
| 14 | +// import Coinbase from "next-auth/providers/coinbase" |
| 15 | +// import Discord from "next-auth/providers/discord" |
| 16 | +// import Dropbox from "next-auth/providers/dropbox" |
| 17 | +// import DuendeIDS6 from "next-auth/providers/duende-identity-server6" |
| 18 | +// import Eveonline from "next-auth/providers/eveonline" |
| 19 | +// import Facebook from "next-auth/providers/facebook" |
| 20 | +// import Faceit from "next-auth/providers/faceit" |
| 21 | +// import FortyTwoSchool from "next-auth/providers/42-school" |
| 22 | +// import Foursquare from "next-auth/providers/foursquare" |
| 23 | +// import Freshbooks from "next-auth/providers/freshbooks" |
| 24 | +// import Fusionauth from "next-auth/providers/fusionauth" |
| 25 | +import GitHub from "next-auth/providers/github" |
| 26 | +// import Gitlab from "next-auth/providers/gitlab" |
| 27 | +// import Google from "next-auth/providers/google" |
| 28 | +// import Hubspot from "next-auth/providers/hubspot" |
| 29 | +// import Instagram from "next-auth/providers/instagram" |
| 30 | +// import Kakao from "next-auth/providers/kakao" |
| 31 | +// import Keycloak from "next-auth/providers/keycloak" |
| 32 | +// import Line from "next-auth/providers/line" |
| 33 | +// import LinkedIn from "next-auth/providers/linkedin" |
| 34 | +// import Mailchimp from "next-auth/providers/mailchimp" |
| 35 | +// import Mailru from "next-auth/providers/mailru" |
| 36 | +// import Medium from "next-auth/providers/medium" |
| 37 | +// import Naver from "next-auth/providers/naver" |
| 38 | +// import Netlify from "next-auth/providers/netlify" |
| 39 | +// import Okta from "next-auth/providers/okta" |
| 40 | +// import Onelogin from "next-auth/providers/onelogin" |
| 41 | +// import Osso from "next-auth/providers/osso" |
| 42 | +// import Osu from "next-auth/providers/osu" |
| 43 | +// import Passage from "next-auth/providers/passage" |
| 44 | +// import Patreon from "next-auth/providers/patreon" |
| 45 | +// import Pinterest from "next-auth/providers/pinterest" |
| 46 | +// import Pipedrive from "next-auth/providers/pipedrive" |
| 47 | +// import Reddit from "next-auth/providers/reddit" |
| 48 | +// import Salesforce from "next-auth/providers/salesforce" |
| 49 | +// import Slack from "next-auth/providers/slack" |
| 50 | +// import Spotify from "next-auth/providers/spotify" |
| 51 | +// import Strava from "next-auth/providers/strava" |
| 52 | +// import Todoist from "next-auth/providers/todoist" |
| 53 | +// import Trakt from "next-auth/providers/trakt" |
| 54 | +// import Twitch from "next-auth/providers/twitch" |
| 55 | +// import Twitter from "next-auth/providers/twitter" |
| 56 | +// import UnitedEffects from "next-auth/providers/united-effects" |
| 57 | +// import Vk from "next-auth/providers/vk" |
| 58 | +// import Wikimedia from "next-auth/providers/wikimedia" |
| 59 | +// import Wordpress from "next-auth/providers/wordpress" |
| 60 | +// import WorkOS from "next-auth/providers/workos" |
| 61 | +// import Yandex from "next-auth/providers/yandex" |
| 62 | +// import Zitadel from "next-auth/providers/zitadel" |
| 63 | +// import Zoho from "next-auth/providers/zoho" |
| 64 | +// import Zoom from "next-auth/providers/zoom" |
| 65 | + |
| 66 | +import type { NextAuthConfig } from "next-auth" |
| 67 | + |
| 68 | +export const config = { |
| 69 | + theme: { |
| 70 | + logo: "https://next-auth.js.org/img/logo/logo-sm.png", |
| 71 | + }, |
| 72 | + providers: [ |
| 73 | + // Apple, |
| 74 | + // Atlassian, |
| 75 | + // Auth0, |
| 76 | + // Authentik, |
| 77 | + // AzureAD, |
| 78 | + // AzureB2C, |
| 79 | + // Battlenet, |
| 80 | + // Box, |
| 81 | + // BoxyHQSAML, |
| 82 | + // Bungie, |
| 83 | + // Cognito, |
| 84 | + // Coinbase, |
| 85 | + // Discord, |
| 86 | + // Dropbox, |
| 87 | + // DuendeIDS6, |
| 88 | + // Eveonline, |
| 89 | + // Facebook, |
| 90 | + // Faceit, |
| 91 | + // FortyTwoSchool, |
| 92 | + // Foursquare, |
| 93 | + // Freshbooks, |
| 94 | + // Fusionauth, |
| 95 | + GitHub, |
| 96 | + // Gitlab, |
| 97 | + // Google, |
| 98 | + // Hubspot, |
| 99 | + // Instagram, |
| 100 | + // Kakao, |
| 101 | + // Keycloak, |
| 102 | + // Line, |
| 103 | + // LinkedIn, |
| 104 | + // Mailchimp, |
| 105 | + // Mailru, |
| 106 | + // Medium, |
| 107 | + // Naver, |
| 108 | + // Netlify, |
| 109 | + // Okta, |
| 110 | + // Onelogin, |
| 111 | + // Osso, |
| 112 | + // Osu, |
| 113 | + // Passage, |
| 114 | + // Patreon, |
| 115 | + // Pinterest, |
| 116 | + // Pipedrive, |
| 117 | + // Reddit, |
| 118 | + // Salesforce, |
| 119 | + // Slack, |
| 120 | + // Spotify, |
| 121 | + // Strava, |
| 122 | + // Todoist, |
| 123 | + // Trakt, |
| 124 | + // Twitch, |
| 125 | + // Twitter, |
| 126 | + // UnitedEffects, |
| 127 | + // Vk, |
| 128 | + // Wikimedia, |
| 129 | + // Wordpress, |
| 130 | + // WorkOS, |
| 131 | + // Yandex, |
| 132 | + // Zitadel, |
| 133 | + // Zoho, |
| 134 | + // Zoom, |
| 135 | + ], |
| 136 | + callbacks: { |
| 137 | + authorized({ request, auth }) { |
| 138 | + const { pathname } = request.nextUrl |
| 139 | + if (pathname === "/middleware-example") return !!auth |
| 140 | + return true |
| 141 | + }, |
| 142 | + jwt({ token, trigger, session }) { |
| 143 | + if (trigger === "update") token.name = session.user.name |
| 144 | + return token |
| 145 | + }, |
| 146 | + }, |
| 147 | +} satisfies NextAuthConfig |
| 148 | + |
| 149 | +export const { handlers, auth, signIn, signOut } = NextAuth(config) |
0 commit comments