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

add cli support for gerating Magic.Link authentication provider #644

Merged
merged 3 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The following CLI command will install required packages and generate boilerplat
```bash
yarn rw g auth [provider]
```
*`[provider]` values can be either "netlify" or "auth0".*
*`[provider]` values can be either "netlify", "auth0" or "magic-link".*

### Manual Install
#### Netlify Identity Widget
Expand All @@ -31,6 +31,12 @@ yarn add @redwoodjs/auth netlify-identity-widget
cd web
yarn add @redwoodjs/auth @auth0/auth0-spa-js
```
#### Magic.Link

```bash
cd web
yarn add @redwoodjs/auth magic-sdk
```

## Setup

Expand Down
16 changes: 16 additions & 0 deletions packages/cli/src/commands/generate/auth/providers/magic-link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const config = {
imports: [{ import: '{ Magic }', from: 'magic-sdk' }],
init: 'const m = new Magic(process.env.MAGICLINK_PUBLIC)',
authProvider: {
client: 'm',
type: 'magic.link',
},
}

export const packages = ['magic-sdk']

export const notes = [
'To get your application keys, go to https://dashboard.magic.link/login ',
'Then navigate to the API keys add them to your .env config options.',
'See: https://redwoodjs.com/docs/authentication#for-magiclink',
]