Skip to content

Commit

Permalink
[gh-#783] spell unknown correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
khaliqgant committed Jul 16, 2023
1 parent ee67bfc commit f6acbc2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/server/lib/controllers/access.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export class AccessMiddleware {
environmentId = result?.environmentId as number;
} catch (e) {
errorManager.report(e);
return errorManager.errRes(res, 'unkown_account');
return errorManager.errRes(res, 'unknown_account');
}

if (accountId == null) {
return errorManager.errRes(res, 'unkown_account');
return errorManager.errRes(res, 'unknown_account');
}

setAccount(accountId, res);
Expand Down
4 changes: 2 additions & 2 deletions packages/server/lib/controllers/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ class AuthController {
if (token) {
jwt.verify(token, resetPasswordSecret(), async (error: any, _: any) => {
if (error) {
errorManager.errRes(res, 'unkown_password_reset_token');
errorManager.errRes(res, 'unknown_password_reset_token');
return;
}

const user = await userService.getUserByResetPasswordToken(token);

if (!user) {
errorManager.errRes(res, 'unkown_password_reset_token');
errorManager.errRes(res, 'unknown_password_reset_token');
return;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/server/lib/controllers/connection.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ConnectionController {
content: 'Unknown connection'
});

errorManager.errRes(res, 'unkown_connection');
errorManager.errRes(res, 'unknown_connection');
return;
}

Expand Down Expand Up @@ -201,7 +201,7 @@ class ConnectionController {
const connection: Connection | null = await connectionService.getConnection(connectionId, providerConfigKey, environment.id);

if (connection == null) {
errorManager.errRes(res, 'unkown_connection');
errorManager.errRes(res, 'unknown_connection');
return;
}

Expand Down Expand Up @@ -313,7 +313,7 @@ class ConnectionController {
const connection: Connection | null = await connectionService.getConnection(connectionId, providerConfigKey, environmentId);

if (connection == null) {
errorManager.errRes(res, 'unkown_connection');
errorManager.errRes(res, 'unknown_connection');
return;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/shared/lib/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Analytics {
eventProperties['host'] = baseUrl;
eventProperties['user-type'] = userType;
eventProperties['user-account'] = userId;
eventProperties['nango-server-version'] = this.packageVersion || 'unkown';
eventProperties['nango-server-version'] = this.packageVersion || 'unknown';

if (isCloud() && accountId != null) {
const account: Account | null = await accountService.getAccountById(accountId);
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/lib/utils/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class NangoError extends Error {
this.message = 'Authentication failed. The Authorization header is malformed.';
break;

case 'unkown_account':
case 'unknown_account':
this.status = 401;
this.message = 'Authentication failed. The provided secret/public key does not match any account.';
break;
Expand Down Expand Up @@ -154,7 +154,7 @@ export class NangoError extends Error {
this.message = `Missing param 'connection_id'.`;
break;

case 'unkown_connection':
case 'unknown_connection':
this.status = 400;
this.message = `No connection matching the provided params of 'connection_id' and 'provider_config_key'.`;
if (this.payload) {
Expand Down Expand Up @@ -196,7 +196,7 @@ export class NangoError extends Error {
this.message = 'Missing reset token (or password).';
break;

case 'unkown_password_reset_token':
case 'unknown_password_reset_token':
this.status = 404;
this.message = 'Reset password token expired on unknown.';
break;
Expand Down

0 comments on commit f6acbc2

Please sign in to comment.