Commit 9672d17
committed
fix: init clerk only on cloud (#3028)
### TL;DR
Conditionally initialize Clerk authentication based on app type
### What changed?
Modified the `auth.ts` file to only initialize the Clerk authentication client when the application is running in cloud mode. When not in cloud mode, the clerk variable is set to null (cast as Clerk type).
### How to test?
1. Verify that authentication works correctly in cloud environments
2. Confirm that the application doesn't attempt to initialize Clerk in non-cloud environments
3. Check that no authentication errors occur in either environment
### Why make this change?
This change prevents unnecessary Clerk initialization in non-cloud environments where authentication might be handled differently or not needed. This improves efficiency and prevents potential errors from attempting to use Clerk with invalid or missing credentials in development or other non-cloud contexts.1 parent 67584f2 commit 9672d17
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments