Argument of type 'string' is not assignable to parameter of type '"api"' #1438
-
After migrating to the new version an error appeared and I did not understand what happened. Could someone help me? protected async authenticate(auth: HttpContextContract['auth'], guards: string[]) {
for (let guard of guards) {
if (await auth.use(guard).check()) {
/**
* Instruct auth to use the given guard as the default guard for
* the rest of the request, since the user authenticated
* succeeded here
*/
auth.defaultGuard = guard
return true
}
}
/**
* Unable to authenticate using any guard
*/
throw new AuthenticationException(
'Unauthorized access',
'E_UNAUTHORIZED_ACCESS',
this.redirectTo
)
}
env "Node": "12.18.2",
"NPM": "6.14.5",
"@adonisjs/ace": "^6.0.0",
"@adonisjs/auth": "^4.2.4",
"@adonisjs/core": "^5.0.0-preview-rc",
"@adonisjs/fold": "^6.0.0",
"@adonisjs/lucid": "^8.2.2", |
Beta Was this translation helpful? Give feedback.
Answered by
thetutlage
Aug 11, 2020
Replies: 1 comment 1 reply
-
Follow |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
fnoquiq
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Follow
Updating Auth Middleware
section https://preview.adonisjs.com/releases/auth/version-4_3#updating-auth-middleware