-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathkeys.ts
34 lines (30 loc) · 1.2 KB
/
keys.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
// Node module: @loopback/example-access-control-migration
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
import {TokenService, UserService} from '@loopback/authentication';
import {BindingKey} from '@loopback/core';
// The User model is imported from the application,
// which makes the component not entirely independent
import {User} from '../../models/user.model';
import {Credentials} from './services/user.service';
export namespace TokenServiceConstants {
export const TOKEN_SECRET_VALUE = 'myjwts3cr3t';
export const TOKEN_EXPIRES_IN_VALUE = '21600';
}
export namespace TokenServiceBindings {
export const TOKEN_SECRET = BindingKey.create<string>(
'authentication.jwt.secret',
);
export const TOKEN_EXPIRES_IN = BindingKey.create<string>(
'authentication.jwt.expires.in.seconds',
);
export const TOKEN_SERVICE = BindingKey.create<TokenService>(
'services.authentication.jwt.tokenservice',
);
}
export namespace UserServiceBindings {
export const USER_SERVICE = BindingKey.create<UserService<User, Credentials>>(
'services.user.service',
);
}