getProviders = (req, res) => [
  CredentialsProvider({
    id: 'lightning',
    name: 'Lightning',
    credentials: {
      pubkey: { label: 'publickey', type: 'text' },
      k1: { label: 'k1', type: 'text' }
    },
    authorize: async (credentials, req) => {
      return await pubkeyAuth(credentials, req, res, 'pubkey')
    }
  }),
  CredentialsProvider({
    id: 'nostr',
    name: 'Nostr',
    credentials: {
      event: { label: 'event', type: 'text' }
    },
    authorize: async ({ event }, req) => {
      const credentials = await nostrEventAuth(event)
      return await pubkeyAuth(credentials, req, res, 'nostrAuthPubkey')
    }
  }),
  GitHubProvider({
    clientId: process.env.GITHUB_ID,
    clientSecret: process.env.GITHUB_SECRET,
    authorization: {
      url: 'https://github.com/login/oauth/authorize',
      params: { scope: '' }
    },
    profile (profile) {
      return {
        id: profile.id,
        name: profile.login
      }
    }
  }),
  TwitterProvider({
    clientId: process.env.TWITTER_ID,
    clientSecret: process.env.TWITTER_SECRET,
    profile (profile) {
      return {
        id: profile.id,
        name: profile.screen_name
      }
    }
  }),
  EmailProvider({
    server: process.env.LOGIN_EMAIL_SERVER,
    from: process.env.LOGIN_EMAIL_FROM,
    maxAge: 5 * 60, // expires in 5 minutes
    generateVerificationToken: generateRandomString,
    sendVerificationRequest: (...args) => sendVerificationRequest(...args, req)
  })
]
@type {import('next-auth/providers').Provider[]}