@aptana/multichannel-common 2.9.16 → 2.9.17

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.
@@ -27,7 +27,7 @@ export declare class TokenGuard implements Guard {
27
27
  /**
28
28
  * Determine if the current user is authenticated. If not, throw an error.
29
29
  */
30
- authenticate(): Promise<Authenticable>;
30
+ authenticate(): Promise<Authenticable | undefined>;
31
31
  check(): Promise<boolean>;
32
32
  guest(): Promise<boolean>;
33
33
  setUser(user: Authenticable): Promise<void>;
@@ -34,11 +34,18 @@ class TokenGuard {
34
34
  * Determine if the current user is authenticated. If not, throw an error.
35
35
  */
36
36
  async authenticate() {
37
- const user = await this.user();
38
- if (user) {
39
- return user;
37
+ try {
38
+ const user = await this.user();
39
+ if (user) {
40
+ return user;
41
+ }
42
+ }
43
+ catch (error) {
44
+ if (error && error.statusCode) {
45
+ throw error;
46
+ }
47
+ throw new WrongCredentialsError_1.default();
40
48
  }
41
- throw new WrongCredentialsError_1.default();
42
49
  }
43
50
  async check() {
44
51
  return !!(await this.user());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptana/multichannel-common",
3
- "version": "2.9.16",
3
+ "version": "2.9.17",
4
4
  "license": "MIT",
5
5
  "description": "",
6
6
  "keywords": [