Skip to content

Commit

Permalink
docs(egg-passport): add redirection desc while auth succeed (#3260)
Browse files Browse the repository at this point in the history
  • Loading branch information
thonatos authored and atian25 committed Dec 4, 2018
1 parent 7ff98ab commit 64e88ab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/source/en/core/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ Framework provides `.surl()` macro to do url filtering.It is Used to parse the u

You can add `helper.surl($value)` in the template to output variable.

**note: in places where you need to parse the url, you must add double quotes outside of surl, or you will result in XSS vulnerabilities.**
**Note: in places where you need to parse the url, you must add double quotes outside of surl, or you will result in XSS vulnerabilities.**

Do not use `surl`

Expand Down
6 changes: 5 additions & 1 deletion docs/source/en/tutorials/passport.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ config.passportGithub = {
};
```

**note:**
**Note:**

* Create a [GitHub OAuth Apps](https://github.com/settings/applications/new) to get the `clientID` and `clientSecret` information.
* Specify a `callbackURL`, such as `http://127.0.0.1:7001/passport/github/callback`
Expand Down Expand Up @@ -159,6 +159,10 @@ The API also be provided for:
  - `options.callbackURL` - callback address after authorization, defaults to `/passport/${strategy}/callback`
* `app.passport.mount(strategy, options)` - Syntactic sugar for developers to configure routing


**Note:**
- `app.passport.authenticate`, if `options.successRedirect` or `options.successReturnToOrRedirect` is null, it will redirect to `/` by default

## Using Passport Ecosystem

[Passport](http://www.passportjs.org/) has many middleware and it is impossible to have the second encapsulation.
Expand Down
6 changes: 3 additions & 3 deletions docs/source/en/tutorials/socketio.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ exports.io = {
> When `redis` is turned on, the program tries to connect to the redis server at startup
> Here `redis` is only used to store connection instance information, see [# server.adapter](https://socket.io/docs/server-api/#server-adapter-value)
**note:**
**Note:**
If the project also uses the `egg-redis`, please configure it separately. Do not share it.

### Deployment
Expand Down Expand Up @@ -145,7 +145,7 @@ Middleware has the following two scenarios:

It is configured in each namespace, respectively, according to the scenarios given above.

**note:**
**Note:**

If we enable the framework middleware, you will find the following directory in the project:

Expand Down Expand Up @@ -267,7 +267,7 @@ module.exports = app => {
};
```

**note:**
**Note:**

Nsp has the following system events:

Expand Down
3 changes: 3 additions & 0 deletions docs/source/zh-cn/tutorials/passport.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ module.exports = app => {
- `options.callbackURL` - 授权后回调地址,默认为 `/passport/${strategy}/callback`
- `app.passport.mount(strategy, options)` - 语法糖,方便开发者配置路由

**注意:**
- `app.passport.authenticate` 中,未设置 `options.successRedirect` 或者 `options.successReturnToOrRedirect` 将默认跳转 `/`

## 使用 Passport 生态

[Passport] 的中间件很多,不可能都进行二次封装。
Expand Down

0 comments on commit 64e88ab

Please sign in to comment.