diff --git a/_includes/readmes/loopback-android-getting-started.md b/_includes/readmes/loopback-android-getting-started.md index f8a4e5ae2..2e94563fe 100644 --- a/_includes/readmes/loopback-android-getting-started.md +++ b/_includes/readmes/loopback-android-getting-started.md @@ -6,41 +6,42 @@ LoopBack Open Node.js Mobile API Middle tier. ## Setting up the Development Environment - 1. Install [Eclipse Android Development Tools](http://developer.android.com/sdk/index.html) - 1. Open Window > Android SDK Manager, make sure you have these modules - installed: - * Tools > Android SDK Platform-tools 18 or newer - * Tools > Android SDK Build-tools 18 or newer - * Android 4.3 (API 18) > SDK Platform - * Extras > Google Play Services - 1. Import the Android project in this directory: - * Run File > Import - * Select Android > Existing Android Code Into Workspace - * Choose the directory where you have the Getting Started application. - * Select LoopBackExample for import - 1. Import Google Play services library project into your workspace. The - project is located inside the directory where you have installed i - the Android SDK. +1. Install [Eclipse Android Development Tools](http://developer.android.com/sdk/index.html) +1. Open Window > Android SDK Manager, make sure you have these modules + installed: + * Tools > Android SDK Platform-tools 18 or newer + * Tools > Android SDK Build-tools 18 or newer + * Android 4.3 (API 18) > SDK Platform + * Extras > Google Play Services +1. Import the Android project in this directory: + * Run File > Import + * Select Android > Existing Android Code Into Workspace + * Choose the directory where you have the Getting Started application. + * Select LoopBackExample for import +1. Import Google Play services library project into your workspace. The + project is located inside the directory where you have installed i + the Android SDK. * Run File > Import * Select Android > Existing Android Code Into Workspace * Go to - ``` - /extras/google/google_play_services/libproject/google-play-services_lib/ - ``` + + ``` + /extras/google/google_play_services/libproject/google-play-services_lib/ + ``` * Select google-play-services_lib for import * Check "Copy projects into workspace" * Click "Finish". - See this page for more details: - [Set Up Google Play Services SDK](http://developer.android.com/google/play-services/setup.html) - 1. Add google-play-services\_lib as a build dependency of the Guide Application + See this page for more details: + [Set Up Google Play Services SDK](http://developer.android.com/google/play-services/setup.html) +1. Add google-play-services\_lib as a build dependency of the Guide Application * In the Package Explorer, select LoopbackGuideApplication * Run File > Project Properties * Select Android * In the Library frame, click on "Add..." and select google-play-services_lib - 1. Obtain an API key for Google Maps Android API v2 - [instructions](https://developers.google.com/maps/documentation/android/start#obtaining_an_api_key) - and enter it into AndroidManifest.xml. +1. Obtain an API key for Google Maps Android API v2 +[instructions](https://developers.google.com/maps/documentation/android/start#obtaining_an_api_key) +and enter it into AndroidManifest.xml. --- diff --git a/_includes/readmes/loopback-example-access-control.md b/_includes/readmes/loopback-example-access-control.md index 782a3cebd..04973e64f 100644 --- a/_includes/readmes/loopback-example-access-control.md +++ b/_includes/readmes/loopback-example-access-control.md @@ -1,4 +1,4 @@ -#loopback-example-access-control +# loopback-example-access-control ``` $ git clone https://github.com/strongloop/loopback-example-access-control @@ -19,16 +19,16 @@ LoopBack. The application consists of four types of users: Each user type has permission to perform tasks based on their role and the application's ACL (access control list) entries. -##Prerequisites +## Prerequisites -###Tutorials +### Tutorials - [Getting started with LoopBack](http://docs.strongloop.com/display/LB/Getting+started+with+LoopBack) - [Tutorial series - step 1](https://github.com/strongloop/loopback-example#step-one---the-basics) - [Tutorial series - step 2](https://github.com/strongloop/loopback-example#step-two---relations-and-filter) - [Tutorial series - step 3](https://github.com/strongloop/loopback-example#step-three---adding-application-logic) -###Knowledge +### Knowledge - [EJS](https://github.com/visionmedia/ejs) - [body-parser](https://github.com/expressjs/body-parser) @@ -36,11 +36,11 @@ application's ACL (access control list) entries. - [LoopBack models](http://docs.strongloop.com/display/LB/Defining+models) - [LoopBack adding application logic](http://docs.strongloop.com/display/LB/Adding+application+logic) -##Procedure +## Procedure -###Create the application +### Create the application -####Application information +#### Application information - Name: `loopback-example-access-control` - Directory to contain the project: `loopback-example-access-control` @@ -51,9 +51,9 @@ $ slc loopback loopback-example-access-control $ cd loopback-example-access-control ``` -###Add the models +### Add the models -####Model information +#### Model information - Name: `user` - Datasource: `db (memory)` - Base class: `User` @@ -94,7 +94,7 @@ $ slc loopback:model user ... # follow the prompts, repeat for `team` and `project` ``` -###Define the remote methods +### Define the remote methods Define three remote methods in [`project.js`](https://github.com/strongloop/loopback-example-access-control/blob/master/common/models/project.js): @@ -102,9 +102,9 @@ Define three remote methods in [`project.js`](https://github.com/strongloop/loop - [`donate`](https://github.com/strongloop/loopback-example-access-control/blob/master/common/models/project.js#L15-L31) - [`withdraw`](https://github.com/strongloop/loopback-example-access-control/blob/master/common/models/project.js#L33-54) -###Create the model relations +### Create the model relations -####Model relation information +#### Model relation information - `user` - has many @@ -128,7 +128,7 @@ Define three remote methods in [`project.js`](https://github.com/strongloop/loop - Property name for the relation: `user` - Custom foreign key: `ownerId` -###Add model instances +### Add model instances Create a boot script named [`sample-models.js`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/boot/sample-models.js). @@ -143,7 +143,7 @@ This script does the following: - [Creates a role named `admin` and adds a role mapping to make `Bob` an `admin`](/server/boot/sample-models.js#L50-L65) -###Configure server-side views +### Configure server-side views > LoopBack comes preconfigured with EJS out-of-box. This means we can use > server-side templating by simply setting the proper view engine and a @@ -160,7 +160,7 @@ Create [`index.ejs` in the views directory](https://github.com/strongloop/loopba [Configure `server.js`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/server.js#L11-L20) to use server-side templating. Remember to import the [`path`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/server.js#L4) package. -###Add routes +### Add routes Create [`routes.js`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/boot/routes.js). This script does the following: @@ -171,13 +171,13 @@ Create [`routes.js`](https://github.com/strongloop/loopback-example-access-contr > When you log in sucessfully, `projects.html` is rendered with the authenticated user's access token embedded into each link. -###Create the views +### Create the views Create the [`views` directory](https://github.com/strongloop/loopback-example-access-control/tree/master/server/views) to store views. In this directory, create [`index.ejs`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/views/index.ejs) and [`projects.ejs`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/views/projects.ejs). -###Create a role resolver +### Create a role resolver Create [`role-resolver.js`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/boot/role-resolver.js). @@ -186,11 +186,11 @@ Create [`role-resolver.js`](https://github.com/strongloop/loopback-example-acces > denied. Otherwise, we check to see if the user is a team member and process > the request accordingly. -###Create ACL entries +### Create ACL entries > ACLs are used to restrict access to application REST endpoints. -####ACL information +#### ACL information - Deny access to all project REST endpoints - Select the model to apply the ACL entry to: `(all existing models)` @@ -236,9 +236,9 @@ $ slc loopback:acl # follow the prompts, repeat for each ACL listed above ``` -###Try the application +### Try the application -Start the server (`node .`) and open [`localhost:3000`][localhost] in your browser to view the app. You will see logins and explanations related to each user type we created: +Start the server (`node .`) and open [`localhost:3000`](http://localhost:3000) in your browser to view the app. You will see logins and explanations related to each user type we created: - Guest `Guest` - Role = $everyone, $unauthenticated diff --git a/_includes/readmes/loopback-example-connector-rest.md b/_includes/readmes/loopback-example-connector-rest.md index 7282c74e7..ce4f17bff 100644 --- a/_includes/readmes/loopback-example-connector-rest.md +++ b/_includes/readmes/loopback-example-connector-rest.md @@ -1,6 +1,6 @@ [strongloop-website]: http://strongloop.com/ -#loopback-example-rest-connector +# loopback-example-rest-connector - [Overview](#Overview) - [Running the app](#running-the-app) @@ -19,7 +19,7 @@ this REST API. $ git clone https://github.com/strongloop/loopback-example-rest-connector.git $ cd loopback-example-rest-connector/external-server $ npm install -# node . +$ node . ``` In another shell: ``` @@ -35,7 +35,7 @@ explorer or by running `curl localhost:3000/api/Magazines`. ## FAQs The following are common questions related to using the REST connector. -##How do you perform a GET request to a remote server? +## How do you perform a GET request to a remote server? In this example, we have a REST API exposed in [model-config.json](https://github.com/strongloop/loopback-example-rest-connector/blob/master/external-server/server/model-config.json#L31) . diff --git a/_includes/readmes/loopback-example-database-oracle.md b/_includes/readmes/loopback-example-database-oracle.md index 9d35084cb..a381ccc25 100644 --- a/_includes/readmes/loopback-example-database-oracle.md +++ b/_includes/readmes/loopback-example-database-oracle.md @@ -78,22 +78,23 @@ cd loopback-example-database npm install --save loopback-connector-oracle ``` -> ####Automatic PATH modification +> #### Automatic PATH modification +> **⚠️ DEPRECATED loopback 1.x feature** > During installation, you will see: -> ``` -> ... -> --------------------------------------------------------------------------- -> The node-oracle module and the Oracle specific libraries have been -> installed in /Users/sh/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer. > -> The default bashrc (/etc/bashrc) or user's bash_profile (~/.bash_profile) -> paths have been modified to use this path. If you use a shell other than -> bash, please remember to set the DYLD_LIBRARY_PATH prior to using node. +> ... +> --------------------------------------------------------------------------- +> The node-oracle module and the Oracle specific libraries have been +> installed in /Users/sh/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer. +> +> The default bashrc (/etc/bashrc) or user's bash_profile (~/.bash_profile) +> paths have been modified to use this path. If you use a shell other than +> bash, please remember to set the DYLD_LIBRARY_PATH prior to using node. +> +> Example: +> $ export DYLD_LIBRARY_PATH=":/Users/$USER/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/instantclient:/Users/$USER/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/instantclient" +> ... > -> Example: -> $ export DYLD_LIBRARY_PATH=":/Users/$USER/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/instantclient:/Users/$USER/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/instantclient" -> ... -> ``` > > This is a **DEPRECATED** feature from LoopBack 1.x (we will remove this > message in a future update. Due to concerns raised in the past regarding the diff --git a/_includes/readmes/loopback-example-kv-connectors.md b/_includes/readmes/loopback-example-kv-connectors.md index c6e1511f1..694856ae1 100644 --- a/_includes/readmes/loopback-example-kv-connectors.md +++ b/_includes/readmes/loopback-example-kv-connectors.md @@ -1,4 +1,4 @@ -**PLEASE CREATE ISSUES AT https://github.com/strongloop/loopback/issues** +**PLEASE CREATE ISSUES AT ** --- diff --git a/_includes/readmes/loopback-example-middleware.md b/_includes/readmes/loopback-example-middleware.md index 727fa86e5..69ae38182 100644 --- a/_includes/readmes/loopback-example-middleware.md +++ b/_includes/readmes/loopback-example-middleware.md @@ -1,4 +1,4 @@ -#loopback-example-middleware +# loopback-example-middleware ``` $ git clone git@github.com:strongloop/loopback-example-middleware.git $ cd loopback-example-middleware @@ -8,14 +8,13 @@ $ node . - [How do you serve static content via static middleware?](https://github.com/strongloop/loopback-example-middleware#how-do-you-serve-static-content-via-static-middleware) -#How do you serve static content via static middleware? +## How do you serve static content via static middleware? 1. Add static middleware to the [files property](https://github.com/strongloop/loopback-example-middleware/blob/master/server/middleware.json#L17-L19) in middleware.json 2. Delete [`server/boot/root.js`](https://github.com/strongloop/loopback-example-middleware/blob/master/server/boot). 3. Create [`client/index.html`](https://github.com/strongloop/loopback-example-middleware/blob/master/client/index.html) 4. Start the server via `node .` and browse to [`localhost:3000`](http://localhost:3000). You should see `hello world` being served. - -#How do you create a custom error message for all errors? +## How do you create a custom error message for all errors? 1. Create a [single function](https://github.com/strongloop/loopback-example-middleware/blob/master/server/server.js#L33-l41) that all errors are passed to. 2. Set [`app.get('remoting').errorHandler`](https://github.com/strongloop/loopback-example-middleware/blob/master/server/server.js#L23-l31) to call a custom error handler. 3. Create a [`custom error middleware`](https://github.com/strongloop/loopback-example-middleware/blob/master/server/middleware/custom-error.js) to handle errors not thrown by the `loopback.rest()` middleware. diff --git a/_includes/readmes/loopback-example-mixins.md b/_includes/readmes/loopback-example-mixins.md index fdade9c37..638df40f8 100644 --- a/_includes/readmes/loopback-example-mixins.md +++ b/_includes/readmes/loopback-example-mixins.md @@ -18,6 +18,7 @@ Specify mixin locations relative to the `server/model-config.json` file. Multip ### npm module This loads the [loopback-ds-timestamp-mixin](https://www.npmjs.com/package/loopback-ds-timestamp-mixin) module from the top level `node_modules` directory. Note that this module provides a mixin file `time-stamp.js` which is registered as the camel case `TimeStamp` name. + ```js { "_meta": { @@ -43,6 +44,7 @@ This loads the [loopback-ds-timestamp-mixin](https://www.npmjs.com/package/loopb } } ``` + ### The local `server/mixins/` directory Because the `model-config.json` is within the `server` directory this loads the mixins from current mixins directory. diff --git a/_includes/readmes/loopback-example-passport.md b/_includes/readmes/loopback-example-passport.md index 2bdfc1d60..89dff0361 100644 --- a/_includes/readmes/loopback-example-passport.md +++ b/_includes/readmes/loopback-example-passport.md @@ -56,49 +56,47 @@ $ npm install - Copy providers.json.template to providers.json - Update providers.json with your own values for `clientID/clientSecret`. -``` -"facebook-login": { - "provider": "facebook", - "module": "passport-facebook", - "clientID": "xxxxxxxxxxxxxxx", - "clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "callbackURL": "/auth/facebook/callback", - "authPath": "/auth/facebook", - "callbackPath": "/auth/facebook/callback", - "successRedirect": "/auth/account", - "failureRedirect": "/login", - "scope": ["email"], - "failureFlash": true -}, -"facebook-link": { - "provider": "facebook", - "module": "passport-facebook", - "clientID": "xxxxxxxxxxxxxxx", - "clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "callbackURL": "/link/facebook/callback", - "authPath": "/link/facebook", - "callbackPath": "/link/facebook/callback", - "successRedirect": "/auth/account", - "failureRedirect": "/login", - "scope": ["email", "user_likes"], - "link": true, - "failureFlash": true -} -``` + ``` + "facebook-login": { + "provider": "facebook", + "module": "passport-facebook", + "clientID": "xxxxxxxxxxxxxxx", + "clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "callbackURL": "/auth/facebook/callback", + "authPath": "/auth/facebook", + "callbackPath": "/auth/facebook/callback", + "successRedirect": "/auth/account", + "failureRedirect": "/login", + "scope": ["email"], + "failureFlash": true + }, + "facebook-link": { + "provider": "facebook", + "module": "passport-facebook", + "clientID": "xxxxxxxxxxxxxxx", + "clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "callbackURL": "/link/facebook/callback", + "authPath": "/link/facebook", + "callbackPath": "/link/facebook/callback", + "successRedirect": "/auth/account", + "failureRedirect": "/login", + "scope": ["email", "user_likes"], + "link": true, + "failureFlash": true + } + ``` + ### 4. Facebook profile info -If you require additional information from a Facebook profile such as a name or a gender, you can obtain it by updating `node_modules\passport-facebook\lib\strategy.js`and replacing: +In a recent update, Facebook no longer returns all fields by default (email, gender, timezone, etc). +If you need more information, modify the providers template. +The current template contains: ``` -this._profileURL = options.profileURL || 'https://graph.facebook.com/me'; -``` - -with +"profileFields": ["gender", "link", "locale", "name", "timezone", "verified", "email", "updated_time"], ``` -this._profileURL = options.profileURL || - 'https://graph.facebook.com/v2.2/me?fields=first_name,gender,last_name,link,locale,name,timezone,verified,email,updated_time'; -``` +We recommend modifying the fields to suit your needs. For more information regarding the providers template, see http://loopback.io/doc/en/lb2/Configuring-providers.json.html. ### 5. Data file diff --git a/_includes/readmes/loopback-example-relations.md b/_includes/readmes/loopback-example-relations.md index 28b7df04c..31d9e89d9 100644 --- a/_includes/readmes/loopback-example-relations.md +++ b/_includes/readmes/loopback-example-relations.md @@ -250,6 +250,7 @@ Create six boot scripts: ``` - `Book`(please add them manually) + ``` "people": { "type": "embedsMany", @@ -261,20 +262,21 @@ Create six boot scripts: ``` - `Link`(please add them manually) - ``` - "linked": { - "type": "belongsTo", - "polymorphic": { - "idType": "number" - }, - "properties": { - "name": "name" - }, - "options": { - "invertProperties": true - } - } - ``` + + ``` + "linked": { + "type": "belongsTo", + "polymorphic": { + "idType": "number" + }, + "properties": { + "name": "name" + }, + "options": { + "invertProperties": true + } + } + ``` - `Order` - belongs to - `Customer` diff --git a/_includes/readmes/loopback-example-storage.md b/_includes/readmes/loopback-example-storage.md index 680d6ad54..6f49c4726 100644 --- a/_includes/readmes/loopback-example-storage.md +++ b/_includes/readmes/loopback-example-storage.md @@ -5,6 +5,7 @@ Example for [loopback-component-storage](https://github.com/strongloop/loopback- This repository contains two directories: `example-2.0` for the LoopBack 2.x app, and `example`, for the legacy LoopBack 1.x app. Use `example-2.0` unless you are working with a legacy LoopBack 1.x app. Follow these steps to run the example: + ``` $ git clone https://github.com/strongloop/loopback-example-storage.git $ cd loopback-example-storage/example-2.0 @@ -12,7 +13,7 @@ $ npm install $ node . ``` -Then load http://localhost:3000 in your browser. +Then load in your browser. See the documentation for the LoopBack [storage component](https://docs.strongloop.com/display/LB/Storage+component). diff --git a/_includes/readmes/loopback-example-user-management.md b/_includes/readmes/loopback-example-user-management.md index e4fc0b3c8..e1ffdb31e 100644 --- a/_includes/readmes/loopback-example-user-management.md +++ b/_includes/readmes/loopback-example-user-management.md @@ -1,4 +1,5 @@ -#loopback-example-user-management +# loopback-example-user-management + ``` $ git clone git@github.com:strongloop/loopback-example-user-management.git $ cd loopback-example-user-management @@ -13,12 +14,12 @@ $ node . - [How do you log out a user?](https://github.com/strongloop/loopback-example-user-management#how-do-you-log-out-a-user) - [How do you perform a password reset for a registered user](https://github.com/strongloop/loopback-example-user-management#how-do-you-perform-a-password-reset-for-a-registered-user) -######Notes +###### Notes - You will need to [configure LoopBack to send email](https://docs.strongloop.com/display/public/LB/Email+connector) for email related features - If you're using GMail, you can simply [replace the user and pass](https://github.com/strongloop/loopback-example-user-management/blob/master/server/datasources.json#L19-L20) with your own credentials. - With GMail, you might need to temporarily allow "less secure" apps to access you email account. See [Allowing less secure apps to access your account](https://support.google.com/accounts/answer/6010255) for more information. -#Project Layout +## Project Layout - `common/models` contains the extended user files. `user.js` contains user the logic for sending emails and password reset, while `user.json` contains the model definition. - `server/boot/authentication.js` enables authentication middleware with the `enableAuth()` method. It's this middleware that finds the access token id string (usually from the query string) and appends entire token instance onto the express request object as `req.accessToken`. From there, you can find the user's ID: `req.accessToken.userId` (used in the `routes.js` file, see directly below). - `server/boot/routes.js` contains all the routing logic. In this example, we have used [ExpressJS](http://expressjs.com/) to configure the routing since each LoopBack app is an extended version of an Express app. @@ -26,14 +27,14 @@ $ node . - `server/datasources.json` contains the datasource configurations. Here is where we add an email datasource. - `server/model-config.json` contains the all the model configurations. Here is where we configure the extended user model (lowercase 'u') and the email model. The rest of the models are all built-in LoopBack models. -######Note +###### Note All other files have not been modified from their defaults. -#How do you register a new user? +## How do you register a new user? 1. Create a [form](https://github.com/strongloop/loopback-example-user-management/blob/master/server/views/login.ejs#L21-L36) to gather sign up information 2. Create a [remote hook](https://github.com/strongloop/loopback-example-user-management/blob/master/common/models/user.js#L5-L35) to [send a verification email](https://github.com/strongloop/loopback-example-user-management/blob/master/common/models/user.js#L9-L34) -######Notes +###### Notes - Upon execution, [`user.verify`](https://github.com/strongloop/loopback-example-user-management/blob/master/common/models/user.js#L19) sends an email using the provided [options](https://github.com/strongloop/loopback-example-user-management/blob/master/common/models/user.js#L9-L17) - The verification email is configured to [redirect the user to the `/verified` route](https://github.com/strongloop/loopback-example-user-management/blob/master/common/models/user.js#L15) in our example. For your app, you should configure the redirect to match your use case - The [options](https://github.com/strongloop/loopback-example-user-management/blob/master/common/models/user.js#L9-L17) are self-explanitory except `type`, `template` and `user` @@ -41,21 +42,21 @@ All other files have not been modified from their defaults. - `template` - the path to the template to use for the verification email - `user` - when provided, the information in the object will be used in the verification link email -#How do you send an email verification for a new user registration? +## How do you send an email verification for a new user registration? See [step 2](https://github.com/strongloop/loopback-example-user-management#how-do-you-register-a-new-user) in the previous question -#How do you log in a user? +## How do you log in a user? 1. Create a [form to accept login credentials](https://github.com/strongloop/loopback-example-user-management/blob/master/server/views/login.ejs#L2-L17) 2. Create an [route to handle the login request](https://github.com/strongloop/loopback-example-user-management/blob/master/server/boot/routes.js#L20-L41) -#How do you log out a user? +## How do you log out a user? 1. Create a [logout link with the access token embedded into the URL](https://github.com/strongloop/loopback-example-user-management/blob/master/server/views/home.ejs#L4) 2. Call [`User.logout`](https://github.com/strongloop/loopback-example-user-management/blob/master/server/boot/routes.js#L45) with the access token -######Notes +###### Notes - We use the LoopBack token middleware to process access tokens. As long as you provide `access_token` in the query string of URL, the access token object will be provided in `req.accessToken` property in your route handler -#How do you perform a password reset for a registered user? +## How do you perform a password reset for a registered user? 1. Create a [form to gather password reset info](https://github.com/strongloop/loopback-example-user-management/blob/master/server/views/login.ejs#L40-L51) 2. Create an [endpoint to handle the password reset request](https://github.com/strongloop/loopback-example-user-management/blob/master/server/boot/routes.js#L52-L66). Calling `User.resetPassword` ultimately emits a `resetPasswordRequest` event and creates a temporary access token 3. Register an event handler for the `resetPasswordRequest` that sends an email to the registered user. In our example, we provide a [URL](https://github.com/strongloop/loopback-example-user-management/blob/master/common/models/user.js#L40-L41) that redirects the user to a [password reset page authenticated with a temporary access token](https://github.com/strongloop/loopback-example-user-management/blob/master/server/boot/routes.js#L68-L74)