- update to AdonisJS 6

This commit is contained in:
Kaimbacher 2024-03-14 20:25:27 +01:00
parent f828ca4491
commit cb51a4136f
167 changed files with 21485 additions and 21212 deletions

View file

@ -1,4 +1,5 @@
import { Exception } from '@adonisjs/core/build/standalone';
import { Exception } from "@adonisjs/core/exceptions";
import { HttpContext } from "@adonisjs/core/http";
/*
|--------------------------------------------------------------------------
@ -23,21 +24,21 @@ export default class InvalidCredentialException extends Exception {
* Unable to find user
*/
public static invalidUid() {
const error = new this('User not found', 400, 'E_INVALID_AUTH_UID');
const error = new this('User not found', {status: 400, code: 'E_INVALID_AUTH_UID'});
return error;
}
/**
* Invalid user password
*/
public static invalidPassword() {
const error = new this('Password mis-match', 400, 'E_INVALID_AUTH_PASSWORD');
const error = new this('Password mis-match', {status: 400, code: 'E_INVALID_AUTH_PASSWORD'});
return error;
}
/**
* Flash error message and redirect the user back
*/
private respondWithRedirect(error, ctx) {
private respondWithRedirect(error: any, ctx: HttpContext) {
// if (!ctx.session) {
// return ctx.response.status(this.status).send(this.responseText);
// }
@ -59,7 +60,7 @@ export default class InvalidCredentialException extends Exception {
* Handle this exception by itself
*/
public handle(error, ctx) {
public handle(error: any, ctx: HttpContext) {
// return response.status(403).view.render("errors/unauthorized", {
// error: error,
// });