-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0885ec5
commit 779a606
Showing
5 changed files
with
123 additions
and
3 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,27 @@ | ||
import { schema, CustomMessages } from '@ioc:Adonis/Core/Validator' | ||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' | ||
|
||
export default class VerifyMagicLinkValidator { | ||
constructor(protected ctx: HttpContextContract) {} | ||
|
||
public schema = schema.create({ | ||
token: schema.string(), | ||
type: schema.string(), | ||
redirect: schema.string(), | ||
}) | ||
|
||
/** | ||
* Custom messages for validation failures. You can make use of dot notation `(.)` | ||
* for targeting nested fields and array expressions `(*)` for targeting all | ||
* children of an array. For example: | ||
* | ||
* { | ||
* 'profile.username.required': 'Username is required', | ||
* 'scores.*.number': 'Define scores as valid numbers' | ||
* } | ||
* | ||
*/ | ||
public messages: CustomMessages = { | ||
required: '{{ field }} cannot be empty.', | ||
} | ||
} |
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