We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c6d815 commit 6126cc9Copy full SHA for 6126cc9
.changeset/popular-mails-jam.md
@@ -0,0 +1,5 @@
1
+---
2
+'@clerk/shared': patch
3
4
+
5
+Updates error handling check within isEmailLinkError to fix issue where email link errors were not properly returning true.
packages/shared/src/error.ts
@@ -201,12 +201,13 @@ export class EmailLinkError extends Error {
201
constructor(code: string) {
202
super(code);
203
this.code = code;
204
+ this.name = 'EmailLinkError' as const;
205
Object.setPrototypeOf(this, EmailLinkError.prototype);
206
}
207
208
209
export function isEmailLinkError(err: Error): err is EmailLinkError {
- return err instanceof EmailLinkError;
210
+ return err.name === 'EmailLinkError';
211
212
213
export const EmailLinkErrorCode = {
0 commit comments