5htp-core 0.6.0-89 → 0.6.0-9
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.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "5htp-core",
|
|
3
3
|
"description": "Convenient TypeScript framework designed for Performance and Productivity.",
|
|
4
|
-
"version": "0.6.0-
|
|
4
|
+
"version": "0.6.0-9",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/5htp-core.git",
|
|
7
7
|
"license": "MIT",
|
|
@@ -189,9 +189,9 @@ export default abstract class AuthService<
|
|
|
189
189
|
request.res.clearCookie('authorization');
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
public check( request: TRequest,
|
|
193
|
-
public check( request: TRequest,
|
|
194
|
-
public check( request: TRequest,
|
|
192
|
+
public check( request: TRequest, role: TUserRole): TUser;
|
|
193
|
+
public check( request: TRequest, role: false): null;
|
|
194
|
+
public check( request: TRequest, role: TUserRole | false = 'USER'): TUser | null {
|
|
195
195
|
|
|
196
196
|
const user = request.user;
|
|
197
197
|
|
|
@@ -211,11 +211,6 @@ export default abstract class AuthService<
|
|
|
211
211
|
|
|
212
212
|
this.config.debug && console.warn(LogPrefix, "Refusé pour anonyme (" + request.ip + ")");
|
|
213
213
|
throw new AuthRequired('Please login to continue');
|
|
214
|
-
|
|
215
|
-
} else if (user.type !== entity) {
|
|
216
|
-
|
|
217
|
-
this.config.debug && console.warn(LogPrefix, `User type mismatch: ${user.type} (user) vs ${entity} (expected) (${request.ip})`);
|
|
218
|
-
throw new AuthRequired("Your account type doesn't have access to the requested content.");
|
|
219
214
|
|
|
220
215
|
// Insufficient permissions
|
|
221
216
|
} else if (!user.roles.includes(role)) {
|
|
@@ -45,9 +45,9 @@ export default class UsersRequestService<
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// TODO: return user type according to entity
|
|
48
|
-
public check(
|
|
49
|
-
public check(
|
|
50
|
-
public check(
|
|
51
|
-
return this.users.check( this.request,
|
|
48
|
+
public check(role: TUserRole, motivation?: string): TUser;
|
|
49
|
+
public check(role: false, motivation?: string): null;
|
|
50
|
+
public check(role: TUserRole | boolean = 'USER', motivation?: string): TUser | null {
|
|
51
|
+
return this.users.check( this.request, role, motivation );
|
|
52
52
|
}
|
|
53
53
|
}
|
package/types/icons.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TIcones = "solid/spinner-third"|"long-arrow-right"|"
|
|
1
|
+
export type TIcones = "times"|"solid/spinner-third"|"long-arrow-right"|"check-circle"|"coins"|"building"|"at"|"phone"|"brands/linkedin"|"rocket"|"chart-bar"|"user-circle"|"arrow-right"|"crosshairs"|"user-shield"|"shield-alt"|"chart-line"|"money-bill-wave"|"star"|"link"|"file-alt"|"long-arrow-left"|"user-plus"|"mouse-pointer"|"thumbs-up"|"dollar-sign"|"plane-departure"|"plus-circle"|"comments-alt"|"calendar-alt"|"paper-plane"|"user"|"magnet"|"sun"|"brands/whatsapp"|"clock"|"cog"|"trash"|"ellipsis-h"|"plus"|"check"|"regular/shield-check"|"binoculars"|"angle-up"|"angle-down"|"search"|"lightbulb"|"envelope"|"solid/crown"|"eye"|"pen"|"file"|"download"|"info-circle"|"exclamation-circle"|"times-circle"|"arrow-left"|"meh-rolling-eyes"|"solid/star"|"solid/star-half-alt"|"regular/star"|"chevron-left"|"power-off"|"users"|"bug"|"bars"|"broom"|"brands/google"|"minus"|"exclamation-triangle"|"play"|"solid/check-circle"|"solid/exclamation-triangle"|"solid/times-circle"|"hourglass"|"sack-dollar"|"question-circle"|"wind"|"external-link"|"plug"|"minus-circle"|"coin"|"comment-alt"|"arrow-to-bottom"|"briefcase"|"map-marker"|"fire"|"map-marker-alt"|"solid/magic"|"industry"|"calendar"|"globe"|"magic"|"graduation-cap"|"unlink"|"bold"|"italic"|"underline"|"strikethrough"|"subscript"|"superscript"|"code"|"font"|"empty-set"|"horizontal-rule"|"page-break"|"image"|"table"|"poll"|"columns"|"sticky-note"|"caret-right"|"align-left"|"align-center"|"align-right"|"align-justify"|"indent"|"outdent"|"list-ul"|"check-square"|"h1"|"h2"|"h3"|"h4"|"list-ol"|"paragraph"|"quote-left"|"bolt"
|