Merge pull request #5389 from ToolJet/merge-main/v2.0.4

Merge main/v2.0.4
This commit is contained in:
Sherfin Shamsudeen 2023-01-20 23:58:12 +05:30 committed by GitHub
commit dd0015fb39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 7 deletions

View file

@ -1 +1 @@
2.0.3
2.0.4

View file

@ -206,7 +206,10 @@ function resetPassword(params) {
function logout() {
clearUser();
const loginPath = (window.public_config?.SUB_PATH || '/') + 'login';
window.location.href = loginPath + `?redirectTo=${window.location.pathname}`;
const pathname = window.public_config?.SUB_PATH
? window.location.pathname.replace(window.public_config?.SUB_PATH, '')
: window.location.pathname;
window.location.href = loginPath + `?redirectTo=${!(pathname.indexOf('/') === 0) ? '/' : ''}${pathname}`;
}
function clearUser() {

View file

@ -348,7 +348,7 @@ button {
}
.editor-sidebar {
height: 100%;
height: calc(100% - 45px);
position: fixed;
right: 0;
overflow-x: hidden;

View file

@ -25,7 +25,7 @@ export default class GraphqlQueryService implements QueryService {
const json = {
query,
variables: variables || {},
variables: variables ? JSON.parse(variables) : {},
};
try {

View file

@ -3,5 +3,5 @@ export type QueryOptions = {
operation: string;
query: string;
headers?: [string, string][];
variables?: object;
variables?: string;
};

View file

@ -1 +1 @@
2.0.3
2.0.4

View file

@ -1,6 +1,7 @@
import { ExecutionContext, Injectable } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { DataQueriesService } from '@services/data_queries.service';
import { maybeSetSubPath } from 'src/helpers/utils.helper';
@Injectable()
export class QueryAuthGuard extends AuthGuard('jwt') {
@ -12,7 +13,8 @@ export class QueryAuthGuard extends AuthGuard('jwt') {
const request = context.switchToHttp().getRequest();
// unauthenticated users should be able to to run queries of public apps
if (request.route.path === '/api/data_queries/:id/run') {
const apiUrl = maybeSetSubPath('/api/data_queries/:id/run');
if (request.route.path === apiUrl) {
const dataQuery = await this.dataQueriesService.findOne(request.params.id);
const app = dataQuery.dataSource.app;