Repository navigation
test(evals): accept handleAuthkitProxy and app-owned AuthKitProvider modules #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,11 +26,10 @@ export class ReactGrader implements Grader { | |
| async grade(): Promise<GradeResult> { | ||
| const checks: GradeCheck[] = []; | ||
|
|
||
| // Check AuthKitProvider wrapper exists in entry file | ||
| // Can be main.tsx (Vite) or index.tsx (CRA) | ||
| // AuthKitProvider may live in the entry file or an app-owned provider module | ||
| checks.push( | ||
| await this.fileGrader.checkFileWithPattern( | ||
| 'src/{main,index}.tsx', | ||
| 'src/**/*.tsx', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/evals/graders/react.grader.ts
Line: 32
Comment:
**Unused provider passes grading**
If `src/auth/Providers.tsx` imports and renders `AuthKitProvider` and reads the environment config, this search accepts it even when the entry file never mounts it. A component using `useAuth` and a successful build can satisfy the remaining checks, so an app without the provider can receive a passing grade. Check that the matched provider is connected to the entry file.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||
| ['AuthKitProvider', '@workos-inc/authkit-react'], | ||
| 'AuthKitProvider configured with correct SDK', | ||
| ), | ||
|
|
@@ -46,12 +45,12 @@ export class ReactGrader implements Grader { | |
| ), | ||
| ); | ||
|
|
||
| // Check environment config in entry file | ||
| // Env config is read where AuthKitProvider is configured | ||
| // Supports both Vite (import.meta.env) and CRA (process.env) | ||
| checks.push( | ||
| await this.fileGrader.checkFileWithPattern( | ||
| 'src/{main,index}.tsx', | ||
| [/VITE_WORKOS_CLIENT_ID|REACT_APP_WORKOS_CLIENT_ID|import\.meta\.env|process\.env/], | ||
| 'src/**/*.tsx', | ||
| ['AuthKitProvider', /VITE_WORKOS_CLIENT_ID|REACT_APP_WORKOS_CLIENT_ID|import\.meta\.env|process\.env/], | ||
|
greptile-apps[bot] marked this conversation as resolved.
Resolved
|
||
| 'Environment variable configuration', | ||
| ), | ||
| ); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.