Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'authorization' does not exist on type... #10596

Closed
benjiroooo opened this issue Apr 15, 2024 · 2 comments
Closed

Property 'authorization' does not exist on type... #10596

benjiroooo opened this issue Apr 15, 2024 · 2 comments
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@benjiroooo
Copy link

benjiroooo commented Apr 15, 2024

Environment

System:
OS: macOS 14.2.1
CPU: (8) arm64 Apple M2
Memory: 338.44 MB / 24.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.7.2 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.5.0 - /opt/homebrew/bin/npm
pnpm: 8.15.4 - /opt/homebrew/bin/pnpm
Browsers:
Safari: 17.2.1
npmPackages:
@auth/pg-adapter: ^0.8.0 => 0.8.0
@auth/supabase-adapter: ^0.7.0 => 0.7.0
next: 14.1.4 => 14.1.4
next-auth: ^5.0.0-beta.16 => 5.0.0-beta.16
react: ^18 => 18.2.0

Reproduction URL

https://github.com/benjiroooo/smart-code-tutor

Describe the issue

I'm following the tutorial on Auth.js and I'm getting this error:

Property 'authorization' does not exist on type '(<P extends GoogleProfile>(options: OAuthUserConfig<P>) => OAuthConfig<P>) | ((config: OAuthUserConfig<GitHubProfile> & { ...; }) => OAuthConfig<...>)'. Property 'authorization' does not exist on type '<P extends GoogleProfile>(options: OAuthUserConfig<P>) => OAuthConfig<P>'.

auth.ts

import NextAuth from 'next-auth';
import GitHub from 'next-auth/providers/github';
import Google from 'next-auth/providers/google';
import type { NextAuthConfig } from 'next-auth';

import { SupabaseAdapter } from '@auth/supabase-adapter';

export const config = {
  providers: [Google, GitHub],
  pages: {
    signIn: '/login',
  },
  adapter: SupabaseAdapter({
    url: process.env.NEXT_PUBLIC_SUPABASE_URL!,
    secret: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
  }),
} satisfies NextAuthConfig;

export const { handlers, auth, signIn, signOut } = NextAuth(config);

page.tsx

import { signIn, config, auth } from '../../../../auth';

...

{Object.values(config.providers).map((provider, index) => (
       <form key={index} action={provider.authorization.url} method="POST"> <-- Property 'authorization' does not exist on type '(<P extends GoogleProfile>...
              <Button className="flex flex-row gap-2" type="submit">
                  <span>Sign in with {provider.name}</span>
              </Button>
       </form>
))}

...

It looks like there's no property called authorization either.

How to reproduce

Follow this tutorial:
https://authjs.dev/guides/pages/signin

Expected behavior

Map out the list of providers given in auth.ts

@benjiroooo benjiroooo added bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Apr 15, 2024
@SantiagoGaonaC

This comment has been minimized.

@balazsorban44
Copy link
Member

The corresponding docs page have been updated, please check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

3 participants