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

LocalStrategy not found #129

Closed
hgeldenhuys opened this issue Jan 22, 2022 · 2 comments
Closed

LocalStrategy not found #129

hgeldenhuys opened this issue Jan 22, 2022 · 2 comments

Comments

@hgeldenhuys
Copy link

Describe the bug

Following the example code for Local Strategy, the import for LocalStrategy is missing or not found using
import { Authenticator, LocalStrategy } from "remix-auth";

import { Authenticator, LocalStrategy } from "remix-auth";

Your Example Website or App

examples/local

Steps to Reproduce the Bug or Issue

Install npm packages and try to run the app

Expected behavior

Compiler should not complain about missing import

Screenshots or Videos

Screen Shot 2022-01-22 at 3 18 55 PM

Platform

  • OS: macOS
  • Browser: Chrome, Brave (but N/A)
  • Version: N/A

Additional context

No response

@nkrmr
Copy link

nkrmr commented Jan 28, 2022

LocalStrategy change to FormStrategy with 'remix-auth-form'

import { FormStrategy } from "remix-auth-form";

// Tell the Authenticator to use the form strategy
authenticator.use(
  new FormStrategy(async ({ form }) => {
    let email = form.get("email");
    let password = form.get("password");
    let user = await login(email, password);
    // the type of this user must match the type you pass to the Authenticator
    // the strategy will automatically inherit the type if you instantiate
    // directly inside the `use` method
    return user;
  }),
  // each strategy has a name and can be changed to use another one
  // same strategy multiple times, especially useful for the OAuth2 strategy.
  "user-pass"
);

@sergiodxa
Copy link
Owner

sergiodxa commented Feb 6, 2022

Strategies are not exported from the remix-auth package but from individual packages, the LocalStrategy was also replaced by the FormStrategy.

I just removed docs and examples from the repo, you can see examples in the Remix repo.

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

3 participants