Skip to content

Commit c0bc286

Browse files
authored
updated backend folder
1 parent 0171ba9 commit c0bc286

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

course-04/project/c4-final-project-starter-code/backend/src/lambda/auth/auth0Authorizer.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { JwtPayload } from '../../auth/JwtPayload'
99

1010
const logger = createLogger('auth')
1111

12-
const jwksUrl = 'https://test-endpoint.auth0.com/.well-known/jwks.json'
12+
// TODO: Provide a URL that can be used to download a certificate that can be used
13+
// to verify JWT token signature.
14+
// To get this URL you need to go to an Auth0 page -> Show Advanced Settings -> Endpoints -> JSON Web Key Set
15+
const jwksUrl = '...'
1316

1417
export const handler = async (
1518
event: CustomAuthorizerEvent
@@ -56,6 +59,8 @@ async function verifyToken(authHeader: string): Promise<JwtPayload> {
5659
const jwt: Jwt = decode(token, { complete: true }) as Jwt
5760

5861
// TODO: Implement token verification
62+
// You should implement it similarly to how it was implemented for the exercise for the lesson 5
63+
// You can read more about how to do this here: https://auth0.com/blog/navigating-rs256-and-jwks/
5964
return undefined
6065
}
6166

course-04/project/c4-final-project-starter-code/backend/src/lambda/http/deleteTodo.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import 'source-map-support/register'
33
import { APIGatewayProxyEvent, APIGatewayProxyResult, APIGatewayProxyHandler } from 'aws-lambda'
44

55
export const handler: APIGatewayProxyHandler = async (event: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> => {
6-
const todoId = event.pathParameters.todoId
6+
const todoId = event.pathParameters.todoId
77

8-
// TODO: Remove a TODO item by id
9-
return undefined
10-
}
11-
)
8+
// TODO: Remove a TODO item by id
9+
return undefined
10+
}

0 commit comments

Comments
 (0)