Skip to content

Commit 03eae5c

Browse files
authored
[HOTFIX] relative import in Auth.ts (#590)
Fixes this [build error](https://app.netlify.com/sites/kuzzle-admin-console/deploys/60099111179c6800077bab7a) (seen on the Amin Console Netlify build). Webpack looks for a package called `src/types/RequestPayload` since the path doesn't start with `.`.
1 parent 61f8110 commit 03eae5c

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kuzzle-sdk",
3-
"version": "7.5.1",
3+
"version": "7.5.2",
44
"description": "Official Javascript SDK for Kuzzle",
55
"author": "The Kuzzle Team <[email protected]>",
66
"repository": {

src/controllers/Auth.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Jwt } from '../core/Jwt';
22
import { BaseController } from './Base';
33
import { User } from '../core/security/User';
44
import { JSONObject, ApiKey } from '../types';
5-
import { RequestPayload } from 'src/types/RequestPayload';
5+
import { RequestPayload } from '../types/RequestPayload';
66

77
/**
88
* Auth controller
@@ -30,11 +30,11 @@ export class AuthController extends BaseController {
3030
/**
3131
* Authentication token in use
3232
*/
33-
get authenticationToken (): any | null {
33+
get authenticationToken(): any | null {
3434
return this._authenticationToken;
3535
}
3636

37-
set authenticationToken (encodedJwt: any) {
37+
set authenticationToken(encodedJwt: any) {
3838
if (encodedJwt === undefined || encodedJwt === null) {
3939
this._authenticationToken = null;
4040
}
@@ -51,9 +51,9 @@ export class AuthController extends BaseController {
5151
* a developer simply wishes to verify their token
5252
*/
5353
authenticateRequest (request: any) {
54-
if ( !this.authenticationToken
54+
if ( ! this.authenticationToken
5555
|| (request.controller === 'auth'
56-
&& (request.action === 'checkToken' || request.action === 'login'))
56+
&& (request.action === 'checkToken' || request.action === 'login'))
5757
) {
5858
return;
5959
}
@@ -383,7 +383,7 @@ export class AuthController extends BaseController {
383383
login (
384384
strategy: string,
385385
credentials: JSONObject,
386-
expiresIn?: string|number
386+
expiresIn?: string | number
387387
): Promise<string> {
388388
const request = {
389389
strategy,
@@ -392,16 +392,16 @@ export class AuthController extends BaseController {
392392
action: 'login'
393393
};
394394

395-
return this.query(request, {queuable: false, verb: 'POST'})
395+
return this.query(request, { queuable: false, verb: 'POST' })
396396
.then(response => {
397397
this._authenticationToken = new Jwt(response.result.jwt);
398398

399-
this.kuzzle.emit('loginAttempt', {success: true});
399+
this.kuzzle.emit('loginAttempt', { success: true });
400400

401401
return response.result.jwt;
402402
})
403403
.catch(err => {
404-
this.kuzzle.emit('loginAttempt', {success: false, error: err.message});
404+
this.kuzzle.emit('loginAttempt', { success: false, error: err.message });
405405
throw err;
406406
});
407407
}
@@ -507,7 +507,7 @@ export class AuthController extends BaseController {
507507
* @returns The refreshed token
508508
*/
509509
refreshToken(
510-
options: { queuable?: boolean, expiresIn?: number|string } = {}
510+
options: { queuable?: boolean, expiresIn?: number | string } = {}
511511
): Promise<{
512512
/**
513513
* Token unique ID

0 commit comments

Comments
 (0)