simov / grant

OAuth Proxy
MIT License
4.08k stars 257 forks source link

Not working with Next 13 App Router #289

Closed samiam376 closed 1 year ago

samiam376 commented 1 year ago

I'm trying to authorize Procore on an api route with next 13 and I'm receiving an empty result from grant.vercel.

my provider


    access_url: 'https://sandbox.procore.com/oauth/token',
    authorize_url: 'https://sandbox.procore.com/oauth/authorize',
    request_url: 'https://sandbox.procore.com/oauth/token',
    redirect_uri: getProcoreRedirectUri(),
    client_id: getProcoreClientId(),
    client_secret: getProcoreClientSecret(),
    oauth: 2,
  };```

my conifg ```  const config: GrantConfig = {
    defaults: {
      origin: 'http://localhost:3000',
      state: true,
      prefix: '/api/oauth',
      transport: 'state',
      response: ['tokens', 'raw', 'jwt', 'profile'],
    },
    procore: PROCORE_DEV,
  };

  const grantVercel = grant.vercel({
    config,
    session: { secret: 'grant' },
  });```.

I'm passing in a NextRequest object for the request - which I think may be causing issues.