You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+19-18
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ npm i --save @descope/node-sdk
14
14
15
15
## What do you want to implement?
16
16
17
-
Click one of the following links to open the documentation for that specific functionality.
17
+
Click one of the following links to open the documentation for that specific functionality.
18
18
19
19
-[x][One time passwords (OTP)](./docs/otp.md)
20
20
-[x][Magic Links](./docs/magiclink.md)
@@ -26,7 +26,7 @@ Instantly run the end-to-end ExpresSDK for NodeJS examples, as shown below. The
26
26
27
27
### Prerequisites
28
28
29
-
Run the following commands in your project. Replace any instance of `<ProjectID>` in the code below with your company's Project ID, which can be found in the [Descope console](https://app.descope.com).
29
+
Run the following commands in your project. Replace any instance of `<ProjectID>` in the code below with your company's Project ID, which can be found in the [Descope console](https://app.descope.com).
30
30
31
31
This commands will add the Descope NodeJS SDK as a project dependency, clone the SDK repository locally, and set the `DESCOPE_PROJECT_ID`.
Copy file name to clipboardexpand all lines: docs/magiclink.md
+25-23
Original file line number
Diff line number
Diff line change
@@ -11,52 +11,54 @@ flowchart LR
11
11
12
12
### Prerequisites
13
13
14
-
Replace any instance of `<ProjectID>` in the code below with your company's Project ID, which can be found in the [Descope console](https://app.descope.com).
14
+
Replace any instance of `<ProjectID>` in the code below with your company's Project ID, which can be found in the [Descope console](https://app.descope.com).
15
15
16
-
* Run the following commands in your project
16
+
- Run the following commands in your project
17
17
18
-
These commands will add the Descope NodeJS SDK as a project dependency.
18
+
These commands will add the Descope NodeJS SDK as a project dependency.
19
19
20
-
```bash
21
-
npm i --save @descope/node-sdk
22
-
```
20
+
```bash
21
+
npm i --save @descope/node-sdk
22
+
```
23
23
24
-
* Import and initialize the ExpresSDK forNodeJS clientin your source code
24
+
- Import and initialize the ExpresSDK for NodeJS client in your source code
In your sign-up route using magic link (for example, `myapp.com/signup`) generate a sign-up request and send the magic link via the selected delivery method. In the example below an email is sent to "[email protected]" containing the magic link and the link will automatically return back to the provided URL ("https://mydomain.com/verify"). In additon, optional user data (for exmaple, a custom username in the code sample below) can be gathered during the sign-up process.
In your sign-in route using magic link (for exmaple, `myapp.com/login`) generate a sign-in request send the magic link via the selected delivery method. In the example below an email is sent to "[email protected]" containing the magic link and the link will automatically return back to the provided URL ("https://mydomain.com/verify").
47
+
48
+
In your sign-in route using magic link (for exmaple, `myapp.com/login`) generate a sign-in request send the magic link via the selected delivery method. In the example below an email is sent to "[email protected]" containing the magic link and the link will automatically return back to the provided URL ("https://mydomain.com/verify").
Session validation checks to see that the visitor to your website or application is who they say they are, by comparing the value in the validation variables against the session data that is already stored.
66
68
67
69
```javascript
68
-
const out = await descopeClient.validateSession(session_jwt, refresh_jwt)
0 commit comments