-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Cannot create proxy with a non-object as target or handler
Some users are storing original JWT (as string) inside authInfo/securityContext by using custom checkAuth or checkAuthMiddleware, which is unexpected (must be object) and can cause this issue. I started to use {} as the default value for securityContext when it's not an object before passing it to schema-compiler. I've added a warning when a user is storing not object inside securityContext to indicate that they are doing something wrong.
- Loading branch information
Showing
6 changed files
with
191 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function getRealType(value: any): string { | ||
if (value === null) { | ||
return 'null'; | ||
} | ||
|
||
return typeof value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { getRealType } from '../src'; | ||
|
||
test('getRealType', () => { | ||
expect(getRealType(1)).toBe('number'); | ||
expect(getRealType({})).toBe('object'); | ||
expect(getRealType(null)).toBe('null'); | ||
}); |