Skip to content

Commit ca7e84d

Browse files
committed
Fix typo in README.md
1 parent 529f094 commit ca7e84d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ Authentication can be totally configured adding an _Authentication_ section in t
4242
"Audiences": [ "audience" ], // Optional
4343
"ExpirationTime": "01:00:00", // Default: No expiration
4444
"ClockSkew": "00:02:00", // Default: 5 minutes
45-
"EnableJwtBearerService": true // Default: true
4645
},
4746
"ApiKey": {
4847
"SchemeName": "ApiKey", // Default: ApiKey
@@ -142,7 +141,7 @@ builder.Services.AddOpenApi(options =>
142141
When using JWT Bearer authentication, you can set the _EnableJwtBearerService_ setting to _true_ to automatically register an implementation of the [IJwtBearerService](https://github.com/marcominerva/SimpleAuthentication/blob/master/src/SimpleAuthentication.Abstractions/JwtBearer/IJwtBearerService.cs) interface to create a valid JWT Bearer, according to the setting you have specified in the _appsettings.json_ file:
143142

144143
```csharp
145-
app.MapPost("api/auth/login", (LoginRequest loginRequest, IJwtBearerService jwtBearerService) =>
144+
app.MapPost("api/auth/login", async (LoginRequest loginRequest, IJwtBearerService jwtBearerService) =>
146145
{
147146
// Check for login rights...
148147
@@ -153,7 +152,7 @@ app.MapPost("api/auth/login", (LoginRequest loginRequest, IJwtBearerService jwtB
153152
new(ClaimTypes.Surname, "Minerva")
154153
};
155154

156-
var token = jwtBearerService.CreateToken(loginRequest.UserName, claims);
155+
var token = await jwtBearerService.CreateTokenAsync(loginRequest.UserName, claims);
157156
return TypedResults.Ok(new LoginResponse(token));
158157
});
159158

0 commit comments

Comments
 (0)