diff --git a/packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts b/packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts index 420c9919de..2903a766db 100644 --- a/packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts +++ b/packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts @@ -34,7 +34,7 @@ export function initStrategies(router): void { ApiToken.getByToken(token) .then((apiToken) => { if (!apiToken) { - return done({ msg: 'Invalid tok' }); + return done({ msg: 'Invalid token' }); } if (!apiToken.fk_user_id) return done(null, { roles: 'editor' }); @@ -44,7 +44,7 @@ export function initStrategies(router): void { if (req.ncProjectId) { ProjectUser.get(req.ncProjectId, user.id) .then(async (projectUser) => { - user.roles = projectUser?.roles || 'user'; + user.roles = projectUser?.roles || user.roles; user.roles = user.roles === 'owner' ? 'owner,creator' : user.roles; // + (user.roles ? `,${user.roles}` : ''); @@ -169,7 +169,7 @@ export function initStrategies(router): void { ProjectUser.get(req.ncProjectId, user.id) .then(async (projectUser) => { - user.roles = projectUser?.roles || 'user'; + user.roles = projectUser?.roles || user.roles; user.roles = user.roles === 'owner' ? 'owner,creator' : user.roles; // + (user.roles ? `,${user.roles}` : ''); @@ -287,7 +287,7 @@ export function initStrategies(router): void { if (req.ncProjectId) { ProjectUser.get(req.ncProjectId, user.id) .then(async (projectUser) => { - user.roles = projectUser?.roles || 'user'; + user.roles = projectUser?.roles || user.roles; user.roles = user.roles === 'owner' ? 'owner,creator' : user.roles; // + (user.roles ? `,${user.roles}` : ''); diff --git a/packages/nocodb/src/lib/migrations/v2/nc_021_add_fields_in_token.ts b/packages/nocodb/src/lib/migrations/v2/nc_021_add_fields_in_token.ts index 1636b84af7..b270aa5da4 100644 --- a/packages/nocodb/src/lib/migrations/v2/nc_021_add_fields_in_token.ts +++ b/packages/nocodb/src/lib/migrations/v2/nc_021_add_fields_in_token.ts @@ -24,25 +24,3 @@ const down = async (knex) => { }; export { up, down }; - -/** - * @copyright Copyright (c) 2021, Xgene Cloud Ltd - * - * @author Wing-Kam Wong - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ diff --git a/packages/nocodb/src/lib/models/Store.ts b/packages/nocodb/src/lib/models/Store.ts index fb8955bb4c..3fffcb122f 100644 --- a/packages/nocodb/src/lib/models/Store.ts +++ b/packages/nocodb/src/lib/models/Store.ts @@ -4,6 +4,7 @@ import Noco from '../Noco'; import { MetaTable } from '../utils/globals'; import { SortType } from 'nocodb-sdk'; +// Store is used for storing key value pairs export default class Store { key?: string; value?: string; diff --git a/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts index cd8a572e7c..8257fcf29f 100644 --- a/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts +++ b/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts @@ -315,7 +315,7 @@ export default class RestAuthCtrl { if (apiToken) { done(null, { roles: 'editor' }); } else { - return done({ msg: 'Invalid tok' }); + return done({ msg: 'Invalid token' }); } }) );