File tree Expand file tree Collapse file tree 7 files changed +13
-16
lines changed
components/sketch/SketchMain/Preview Expand file tree Collapse file tree 7 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 11API_URL = http://localhost:8000/api
2+ PREVIEW_URL = http://localhost:9999
23OAUTH2_GOOGLE_CLIENT_ID = " string"
34OAUTH2_GITHUB_CLIENT_ID = " string"
Original file line number Diff line number Diff line change @@ -69,6 +69,14 @@ module.exports = configure(function (/* ctx */) {
6969 CODESPACE_NAME : process . env . CODESPACE_NAME ,
7070 GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN :
7171 process . env . GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN ,
72+ PREVIEW_URL : process . env . GITPOD_WORKSPACE_URL
73+ ? process . env . GITPOD_WORKSPACE_URL . replace (
74+ "https://" ,
75+ "https://9999-"
76+ )
77+ : process . env . CODESPACE_NAME
78+ ? `https://${ process . env . CODESPACE_NAME } -9999.${ process . env . GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN } `
79+ : undefined ,
7280 ...require ( "dotenv" ) . config ( ) . parsed ,
7381 } ,
7482 rawDefine : {
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export function loginWithGoogle() {
5454 // Parameters to pass to OAuth 2.0 endpoint.
5555 const params = {
5656 client_id : process . env . OAUTH2_GOOGLE_CLIENT_ID ,
57- redirect_uri : `${ APP_URL } login?oauth2=true&type=google` ,
57+ redirect_uri : `${ location . origin } / login?oauth2=true&type=google` ,
5858 response_type : "id_token" ,
5959 scope : "email profile openid" ,
6060 nonce : "1" ,
@@ -72,7 +72,7 @@ export function loginWithGithub() {
7272 // Parameters to pass to OAuth 2.0 endpoint.
7373 const params = {
7474 client_id : process . env . OAUTH2_GITHUB_CLIENT_ID ,
75- redirect_uri : `${ APP_URL } login?oauth2=true&type=github` ,
75+ redirect_uri : `${ location . origin } login?oauth2=true&type=github` ,
7676 scope : "read:user user:email" ,
7777 }
7878
Original file line number Diff line number Diff line change @@ -53,13 +53,7 @@ const watchFs = new WatcherFs()
5353const iframeLoading = ref (true )
5454// ====== /status ======
5555
56- const srcIFrame = ref (
57- process .env .GITPOD_WORKSPACE_URL
58- ? process .env .GITPOD_WORKSPACE_URL .replace (" https://" , " https://9999-" )
59- : process .env .CODESPACE_NAME
60- ? ` https://${process .env .CODESPACE_NAME }-9999.${process .env .GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN } `
61- : " https://preview-fcanvas.github.io"
62- )
56+ const srcIFrame = ref (process .env .PREVIEW_URL )
6357
6458// eslint-disable-next-line functional/no-let
6559let listenerGetFile: null | (() => void ) = null
Original file line number Diff line number Diff line change @@ -3,10 +3,4 @@ export const isNative =
33 import . meta. env . MODE === "ios" ||
44 import . meta. env . MODE === "electron"
55
6- export const APP_URL = process . env . GITPOD_WORKSPACE_URL
7- ? process . env . GITPOD_WORKSPACE_URL . replace ( "https://" , "https://9000-" ) + "/"
8- : process . env . CODESPACE_NAME
9- ? `${ process . env . CODESPACE_NAME } -9000.${ process . env . GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN } /`
10- : process . env . API_URL
11-
126export const FILE_ICON_THEMES = [ "material-icon-theme" , "material-theme-icon" ]
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ declare namespace NodeJS {
44 VUE_ROUTER_MODE : "hash" | "history" | "abstract" | undefined
55 VUE_ROUTER_BASE : string | undefined
66 API_URL : string
7+ PREVIEW_URL : string
78 OAUTH2_GOOGLE_CLIENT_ID : string
89 OAUTH2_GITHUB_CLIENT_ID : string
910 }
Original file line number Diff line number Diff line change 1- declare const API_URL : string
You can’t perform that action at this time.
0 commit comments