aboutsummaryrefslogtreecommitdiffstats
path: root/config/auth.js
diff options
context:
space:
mode:
Diffstat (limited to 'config/auth.js')
-rw-r--r--config/auth.js93
1 files changed, 0 insertions, 93 deletions
diff --git a/config/auth.js b/config/auth.js
deleted file mode 100644
index b831b06..0000000
--- a/config/auth.js
+++ /dev/null
@@ -1,93 +0,0 @@
1
2/** @type {import('@adonisjs/framework/src/Env')} */
3const Env = use('Env');
4
5module.exports = {
6 /*
7 |--------------------------------------------------------------------------
8 | Authenticator
9 |--------------------------------------------------------------------------
10 |
11 | Authentication is a combination of serializer and scheme with extra
12 | config to define on how to authenticate a user.
13 |
14 | Available Schemes - basic, session, jwt, api
15 | Available Serializers - lucid, database
16 |
17 */
18 authenticator: 'jwt',
19
20 /*
21 |--------------------------------------------------------------------------
22 | Session
23 |--------------------------------------------------------------------------
24 |
25 | Session authenticator makes use of sessions to authenticate a user.
26 | Session authentication is always persistent.
27 |
28 */
29 session: {
30 serializer: 'lucid',
31 model: 'App/Models/User',
32 scheme: 'session',
33 uid: 'email',
34 password: 'password',
35 },
36
37 /*
38 |--------------------------------------------------------------------------
39 | Basic Auth
40 |--------------------------------------------------------------------------
41 |
42 | The basic auth authenticator uses basic auth header to authenticate a
43 | user.
44 |
45 | NOTE:
46 | This scheme is not persistent and users are supposed to pass
47 | login credentials on each request.
48 |
49 */
50 basic: {
51 serializer: 'lucid',
52 model: 'App/Models/User',
53 scheme: 'basic',
54 uid: 'email',
55 password: 'password',
56 },
57
58 /*
59 |--------------------------------------------------------------------------
60 | Jwt
61 |--------------------------------------------------------------------------
62 |
63 | The jwt authenticator works by passing a jwt token on each HTTP request
64 | via HTTP `Authorization` header.
65 |
66 */
67 jwt: {
68 serializer: 'lucid',
69 model: 'App/Models/User',
70 scheme: 'jwt',
71 uid: 'email',
72 password: 'password',
73 options: {
74 secret: Env.get('APP_KEY'),
75 },
76 },
77
78 /*
79 |--------------------------------------------------------------------------
80 | Api
81 |--------------------------------------------------------------------------
82 |
83 | The Api scheme makes use of API personal tokens to authenticate a user.
84 |
85 */
86 api: {
87 serializer: 'lucid',
88 model: 'App/Models/User',
89 scheme: 'api',
90 uid: 'email',
91 password: 'password',
92 },
93};