3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix API_URL/API_DOMAIN usage in dashboard

This commit is contained in:
Dragory 2022-06-26 15:24:24 +03:00
parent 122f535e34
commit bc250209d8
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
4 changed files with 7 additions and 7 deletions

View file

@ -1,5 +1,5 @@
import { RootStore } from "./store";
const apiUrl = process.env.API_URL;
const apiUrl = `https://${process.env.API_DOMAIN}`;
type QueryParamObject = { [key: string]: string | null };

View file

@ -11,7 +11,7 @@ const isAuthenticated = async () => {
export const authGuard: NavigationGuard = async (to, from, next) => {
if (await isAuthenticated()) return next();
window.location.href = `${process.env.API_URL}/auth/login`;
window.location.href = `https://${process.env.API_DOMAIN}/auth/login`;
};
export const loginCallbackGuard: NavigationGuard = async (to, from, next) => {
@ -25,5 +25,5 @@ export const loginCallbackGuard: NavigationGuard = async (to, from, next) => {
export const authRedirectGuard: NavigationGuard = async (to, form, next) => {
if (await isAuthenticated()) return next("/dashboard");
window.location.href = `${process.env.API_URL}/auth/login`;
window.location.href = `https://${process.env.API_DOMAIN}/auth/login`;
};

View file

@ -20,7 +20,7 @@ Vue.mixin({
return {
get env() {
return Object.freeze({
API_URL: process.env.API_URL,
API_URL: `https://${process.env.API_DOMAIN}`,
});
},
};

View file

@ -1,5 +1,3 @@
require("dotenv").config({ path: path.resolve(process.cwd(), "../.env") });
const path = require("path");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
@ -154,7 +152,9 @@ let config = {
js: ["./src/main.ts"],
},
}),
new DotenvPlugin(),
new DotenvPlugin({
path: path.resolve(process.cwd(), "../.env"),
}),
],
resolve: {
extensions: [".ts", ".tsx", ".js", ".mjs", ".vue"],