UNPKG
@adonisjs/auth
Version:
alpha (5.1.1)
latest (10.0.0)
legacy (3.2.0)
next (10.0.0-next.6)
10.0.0
10.0.0-next.6
10.0.0-next.5
10.0.0-next.4
10.0.0-next.3
10.0.0-next.2
10.0.0-next.1
10.0.0-next.0
9.6.0
9.5.1
9.5.0
9.4.2
9.4.1
9.4.0
9.3.2
9.3.1
9.3.0
9.2.4
9.2.3
9.2.2
9.2.1
9.2.0
9.1.1
9.1.0
9.0.3
9.0.2
9.0.1
9.0.0
9.0.0-10
9.0.0-9
9.0.0-8
9.0.0-7
9.0.0-6
9.0.0-5
9.0.0-4
9.0.0-3
9.0.0-1
9.0.0-0
8.2.3
8.2.2
8.2.1
8.2.0
8.1.0
8.0.12
8.0.11
8.0.10
8.0.9
8.0.8
8.0.7
8.0.6
8.0.5
8.0.4
8.0.3
8.0.2
8.0.1
8.0.0
7.0.0
6.0.1
6.0.0
5.1.1
5.1.0
5.0.2
5.0.1
5.0.0
4.3.1
4.3.0
4.2.4
4.2.3
4.2.2
4.2.1
4.2.0
4.1.5
4.1.4
4.1.3
4.1.2
4.1.1
4.1.0
4.0.4
4.0.3
4.0.2
4.0.1
4.0.0
3.2.0
3.1.0
3.0.7
3.0.6
3.0.5
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.0.11
2.0.10
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
Official authentication provider for Adonis framework
github.com/adonisjs/auth
adonisjs/auth
@adonisjs/auth
/
build
/
src
/
middleware
/
initialize_auth_middleware.js
9 lines
(8 loc)
•
284 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
var
InitializeAuthMiddleware
=
class
{
async
handle
(
ctx, next
) { ctx.
auth
= (
await
ctx.
containerResolver
.
make
(
"auth.manager"
)).
createAuthenticator
(ctx);
if
(
"view"
in
ctx) ctx.
view
.
share
({
auth
: ctx.
auth
});
return
next
(); } };
export
{
InitializeAuthMiddleware
as
default
};