Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergiodxa/remix-auth-strategy-template
A template for creating a new Remix Auth strategy.
https://github.com/sergiodxa/remix-auth-strategy-template
Last synced: 29 days ago
JSON representation
A template for creating a new Remix Auth strategy.
- Host: GitHub
- URL: https://github.com/sergiodxa/remix-auth-strategy-template
- Owner: sergiodxa
- License: mit
- Created: 2021-12-20T04:30:18.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-11T01:04:29.000Z (over 1 year ago)
- Last Synced: 2024-10-05T04:25:59.887Z (about 1 month ago)
- Language: TypeScript
- Size: 162 KB
- Stars: 51
- Watchers: 4
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Remix - remix-auth-strategy-template
README
# Remix Auth - Strategy Template
> A template for creating a new Remix Auth strategy.
If you want to create a new strategy for Remix Auth, you could use this as a template for your repository.
The repo installs the latest version of Remix Auth and do the setup for you to have tests, linting and typechecking.
## How to use it
1. In the `package.json` change `name` to your strategy name, also add a description and ideally an author, repository and homepage keys.
2. In `src/index.ts` change the `MyStrategy` for the strategy name you want to use.
3. Implement the strategy flow inside the `authenticate` method. Use `this.success` and `this.failure` to correctly send finish the flow.
4. In `tests/index.test.ts` change the tests to use your strategy and test it. Inside the tests you have access to `jest-fetch-mock` to mock any fetch you may need to do.
5. Once you are ready, set the secrets on Github
- `NPM_TOKEN`: The token for the npm registry
- `GIT_USER_NAME`: The git username you want the bump workflow to use in the commit.
- `GIT_USER_EMAIL`: The email you want the bump workflow to use in the commit.## Scripts
- `build`: Build the project for production using the TypeScript compiler (strips the types).
- `typecheck`: Check the project for type errors, this also happens in build but it's useful to do in development.
- `lint`: Runs ESLint against the source codebase to ensure it pass the linting rules.
- `test`: Runs all the test using Jest.## Documentations
To facilitate creating a documentation for your strategy, you can use the following Markdown
```markdown
# Strategy Name## Supported runtimes
| Runtime | Has Support |
| ---------- | ----------- |
| Node.js | ✅ |
| Cloudflare | ✅ |## How to use
```