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

Error: Strategy auth0 not found. #113

Open
abbaty48 opened this issue Dec 16, 2024 · 0 comments
Open

Error: Strategy auth0 not found. #113

abbaty48 opened this issue Dec 16, 2024 · 0 comments

Comments

@abbaty48
Copy link

Describe the bug

I keep getting an error stating
Error: Strategy auth0 not found. at Authenticator.authenticate (node_modules\remix-auth\build\authenticator.js:67:19)

I'm using Remix with vite
"@remix-run/node": "^2.15.0",
"@remix-run/react": "^2.15.0",
"@remix-run/serve": "^2.15.0",

I'm using the remix auth version
"remix-auth": "^3.7.0",
"remix-auth-auth0": "^1.10.0",

auth.server.ts

``
import { Auth0Strategy } from "remix-auth-auth0";
import { Authenticator } from "remix-auth";

new Authenticator().use(new Auth0Strategy({
clientID: process.env.AUTH0_CLIENT_ID,
clientSecret: process.env.AUTH0_CLIENT_SECRET,
callbackURL: 'http://localhost:5172/auth/callback',
domain: process.env.AUTH0_DOMAIN
}, async ({ accessToken, refreshToken, extraParams, profile }) => {
console.log('-ACCESS-', accessToken, '- REFRESH -', refreshToken, '-PARAMS-', extraParams, '-PROFILE-', profile)
}))
``

action function

import { Auth0StrategyDefaultName } from 'remix-auth-auth0'; export async function action(request: Request) { return authenticator.authenticate(Auth0StrategyDefaultName, request) }

When i hit the action function, i keep gotting the error
Unexpected Server Error Error: Strategy auth0 not found.

Your Example Website or App

http://localhost:5172

Steps to Reproduce the Bug or Issue

  1. Install package
  2. Create Authenticator instance
  3. Create Auth0Strategy instance
  4. Use the Authenticator instance and invoke the use() method by passing in the Auth0Strategy instance
  5. Use the Authenticator instance and invoke the authenticate method and pass on the strategy name and the request instance

Expected behavior

As expected to see Auth0 login page or redirection

Screenshots or Videos

Screenshot 2024-12-16 at 21-27-30

Platform

  • OS: Windows, Linux
  • Browser: Firefox

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant