asv-hlps 1.2.27 → 1.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { AuthParam } from "../auth";
|
|
2
|
-
import { User } from "../models/entities/users/User";
|
|
3
|
-
import { UserNotarial } from "../models/entities/users/UserNotatial";
|
|
4
2
|
export declare class AuthService {
|
|
5
3
|
tokenKey: string;
|
|
6
|
-
|
|
4
|
+
authStes: string[];
|
|
5
|
+
constructor(tokenkey: string, authStes: string[]);
|
|
7
6
|
getStorageToken: (local?: boolean) => string;
|
|
8
7
|
setStorageToken: (jwt: any) => any;
|
|
9
8
|
decodeToken: () => unknown;
|
|
@@ -11,7 +10,7 @@ export declare class AuthService {
|
|
|
11
10
|
login: (tob: LoginType, httpService: any) => Promise<boolean>;
|
|
12
11
|
logout: () => boolean;
|
|
13
12
|
authUser: () => unknown;
|
|
14
|
-
getAuth: (
|
|
13
|
+
getAuth: (param?: AuthParam) => boolean;
|
|
15
14
|
}
|
|
16
15
|
declare type LoginType = {
|
|
17
16
|
username: string;
|
|
@@ -17,8 +17,9 @@ const jwt_decode_1 = __importDefault(require("jwt-decode"));
|
|
|
17
17
|
const auth_1 = require("../auth");
|
|
18
18
|
const storageService_1 = __importDefault(require("./storageService"));
|
|
19
19
|
class AuthService {
|
|
20
|
-
constructor(tokenkey) {
|
|
20
|
+
constructor(tokenkey, authStes) {
|
|
21
21
|
this.tokenKey = "";
|
|
22
|
+
this.authStes = [];
|
|
22
23
|
// getStorageToken = (tokenKey, local = false) => {
|
|
23
24
|
this.getStorageToken = (local = false) => {
|
|
24
25
|
if (!this.tokenKey) {
|
|
@@ -68,10 +69,14 @@ class AuthService {
|
|
|
68
69
|
return null;
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
/* getAuth = (authUser: User | UserNotarial, authSte: string[], param?: AuthParam) => {
|
|
73
|
+
return getAuth(authUser, authSte, param);
|
|
74
|
+
}; */
|
|
75
|
+
this.getAuth = (param) => {
|
|
76
|
+
return (0, auth_1.getAuth)(this.authUser(), this.authStes, param);
|
|
73
77
|
};
|
|
74
78
|
this.tokenKey = tokenkey;
|
|
79
|
+
this.authStes = authStes;
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
82
|
exports.AuthService = AuthService;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { AuthParam } from "../auth";
|
|
2
|
-
import { User } from "../models/entities/users/User";
|
|
3
|
-
import { UserNotarial } from "../models/entities/users/UserNotatial";
|
|
4
2
|
export declare class AuthService {
|
|
5
3
|
tokenKey: string;
|
|
6
|
-
|
|
4
|
+
authStes: string[];
|
|
5
|
+
constructor(tokenkey: string, authStes: string[]);
|
|
7
6
|
getStorageToken: (local?: boolean) => string;
|
|
8
7
|
setStorageToken: (jwt: any) => any;
|
|
9
8
|
decodeToken: () => unknown;
|
|
@@ -11,7 +10,7 @@ export declare class AuthService {
|
|
|
11
10
|
login: (tob: LoginType, httpService: any) => Promise<boolean>;
|
|
12
11
|
logout: () => boolean;
|
|
13
12
|
authUser: () => unknown;
|
|
14
|
-
getAuth: (
|
|
13
|
+
getAuth: (param?: AuthParam) => boolean;
|
|
15
14
|
}
|
|
16
15
|
declare type LoginType = {
|
|
17
16
|
username: string;
|
|
@@ -11,8 +11,9 @@ import jwtDecode from "jwt-decode";
|
|
|
11
11
|
import { getAuth } from "../auth";
|
|
12
12
|
import storageService from "./storageService";
|
|
13
13
|
export class AuthService {
|
|
14
|
-
constructor(tokenkey) {
|
|
14
|
+
constructor(tokenkey, authStes) {
|
|
15
15
|
this.tokenKey = "";
|
|
16
|
+
this.authStes = [];
|
|
16
17
|
// getStorageToken = (tokenKey, local = false) => {
|
|
17
18
|
this.getStorageToken = (local = false) => {
|
|
18
19
|
if (!this.tokenKey) {
|
|
@@ -62,10 +63,14 @@ export class AuthService {
|
|
|
62
63
|
return null;
|
|
63
64
|
}
|
|
64
65
|
};
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
/* getAuth = (authUser: User | UserNotarial, authSte: string[], param?: AuthParam) => {
|
|
67
|
+
return getAuth(authUser, authSte, param);
|
|
68
|
+
}; */
|
|
69
|
+
this.getAuth = (param) => {
|
|
70
|
+
return getAuth(this.authUser(), this.authStes, param);
|
|
67
71
|
};
|
|
68
72
|
this.tokenKey = tokenkey;
|
|
73
|
+
this.authStes = authStes;
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
// export default new AuthService("awPharma");
|