Skip to content

Use auth hook to wire in session validation and token refresh#1

Closed
heskew wants to merge 1 commit intomainfrom
use-auth-hook
Closed

Use auth hook to wire in session validation and token refresh#1
heskew wants to merge 1 commit intomainfrom
use-auth-hook

Conversation

@heskew
Copy link
Copy Markdown
Member

@heskew heskew commented Sep 10, 2025

No description provided.

@heskew heskew marked this pull request as draft September 10, 2025 03:42
@heskew heskew requested a review from Copilot September 10, 2025 20:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements session validation using authentication hooks to automatically verify and refresh OAuth tokens when needed. This ensures OAuth sessions remain valid without requiring manual intervention.

Key changes:

  • Added sessionValidate auth hook for automatic token refresh
  • Enhanced security with redirect validation to prevent open redirect attacks
  • Updated session structure to use authProvider and authProviderMetadata format

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/index.ts Adds sessionValidate auth hook for automatic token refresh and session validation
src/lib/handlers.ts Updates session handling to use new metadata format and adds redirect validation
src/lib/OAuthProvider.ts Implements processCallback and refreshTokensWithMetadata methods for session management
src/types.ts Extends interfaces with new auth hooks and security configuration options
test/lib/handlers.test.js Updates test mocks and assertions to match new session structure
test/options-watcher.test.js Adds auth mock object to test scope
README.md Documents new security features and configuration options

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/lib/handlers.ts
Comment thread src/lib/handlers.ts
Comment thread src/lib/handlers.ts
Comment thread src/lib/handlers.ts
@heskew heskew changed the title [wip] use sessionValidate auth hook to verify session and refresh token if needed Use auth hook to wire in session validation and token refresh Sep 10, 2025
@heskew heskew marked this pull request as ready for review September 10, 2025 21:20
@heskew heskew marked this pull request as draft September 18, 2025 04:36
@heskew heskew closed this Oct 24, 2025
@heskew heskew deleted the use-auth-hook branch October 28, 2025 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants