Skip to content

Commit

Permalink
Merge pull request Moya#1798 from Moya/docs/access_token_plugin_closu…
Browse files Browse the repository at this point in the history
…re_fix

[Docs] Update AccessTokenPlugin init w/ autoclosure now
  • Loading branch information
sunshinejr authored Feb 12, 2019
2 parents e1e73a7 + 12ce2b3 commit d1d920a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ There are two steps required to start using an `AccessTokenPlugin`.
1. You need to add an `AccessTokenPlugin` to your `MoyaProvider` like this:
```Swift
let token = "eyeAm.AJsoN.weBTOKen"
let authPlugin = AccessTokenPlugin(tokenClosure: token)
let authPlugin = AccessTokenPlugin { token }
let provider = MoyaProvider<YourAPI>(plugins: [authPlugin])
```
The `AccessTokenPlugin` initializer accepts a `tokenClosure` that is responsible
Expand Down
2 changes: 1 addition & 1 deletion docs_CN/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Moya提供一个 `AccessTokenPlugin` 来完成

```Swift
let token = "eyeAm.AJsoN.weBTOKen"
let authPlugin = AccessTokenPlugin(tokenClosure: token)
let authPlugin = AccessTokenPlugin { token }
let provider = MoyaProvider<YourAPI>(plugins: [authPlugin])
```

Expand Down

0 comments on commit d1d920a

Please sign in to comment.