mirror of https://github.com/vapor/docs.git
Adding a "in" keyword in JWT's post route example. (#1065)
<!-- 🚀 Thank you for contributing! -->
There was a "in" keyword missing in the post route example for signing
JWTs. The keyword was simply added to the code snippet.
<!-- Describe your changes clearly and use examples if possible. -->
<!-- When this PR is merged, the title and body will be -->
<!-- used to generate a release automatically. -->
---------
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
This commit is contained in:
parent
0d9e04bb54
commit
47ee8bf16c
|
|
@ -94,7 +94,7 @@ struct TestPayload: JWTPayload {
|
||||||
La firma de la carga útil se realiza llamando al método `sign` en el módulo `JWT`, por ejemplo dentro de un manejador de ruta:
|
La firma de la carga útil se realiza llamando al método `sign` en el módulo `JWT`, por ejemplo dentro de un manejador de ruta:
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
app.post("login") { req async throws -> [String: String]
|
app.post("login") { req async throws -> [String: String] in
|
||||||
let payload = TestPayload(
|
let payload = TestPayload(
|
||||||
subject: "vapor",
|
subject: "vapor",
|
||||||
expiration: .init(value: .distantFuture),
|
expiration: .init(value: .distantFuture),
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ struct TestPayload: JWTPayload {
|
||||||
Signing the payload is done by calling the `sign` method on the `JWT` module, for example inside of a route handler:
|
Signing the payload is done by calling the `sign` method on the `JWT` module, for example inside of a route handler:
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
app.post("login") { req async throws -> [String: String]
|
app.post("login") { req async throws -> [String: String] in
|
||||||
let payload = TestPayload(
|
let payload = TestPayload(
|
||||||
subject: "vapor",
|
subject: "vapor",
|
||||||
expiration: .init(value: .distantFuture),
|
expiration: .init(value: .distantFuture),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue