nuxt-auth-utils icon indicating copy to clipboard operation
nuxt-auth-utils copied to clipboard

Github OAuth flow not working - localhost port is not included in redirect?

Open jamesmorgan opened this issue 7 months ago • 4 comments
trafficstars

As described

Application runs on localhost:3000

  • http://localhost:3000

Using openInPopup('/auth/github')

openInPopup('/auth/github')
  • After a click - GitHub auth launches successfully and github auth model appears

localhost:3000 (with port) set within GitHub OAuth App settings

Image

Redirect without port (github popup)

Image

Redirect without port (browser)

Image

Setting redirect does not seem to do anything?

  • nuxt.config.ts
runtimeConfig: {
        oauth: {
            // provider in lowercase (github, google, etc.)
            'github': {
                clientId: process.env.NUXT_OAUTH_GITHUB_CLIENT_ID,
                clientSecret: process.env.NUXT_OAUTH_GITHUB_CLIENT_SECRET,
                redirectURL: process.env.NUXT_OAUTH_GITHUB_REDIRECT_URL || 'http://localhost:3000/auth/github'
            },
            'google': {
                clientId: process.env.NUXT_OAUTH_GOOGLE_CLIENT_ID,
                clientSecret: process.env.NUXT_OAUTH_GOOGLE_CLIENT_SECRET
            }
        },
        public: {
            apiBaseUrl: process.env.API_BASE_URL || 'http://localhost:3000'
        }
    },

Any ideas what I am missing?

Package:

    "nuxt": "3.15.4",
    "nuxt-auth-utils": "0.5.18",

jamesmorgan avatar Apr 02 '25 20:04 jamesmorgan