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 1
1
API_URL = http://localhost:8000/api
2
+ PREVIEW_URL = http://localhost:9999
2
3
OAUTH2_GOOGLE_CLIENT_ID = " string"
3
4
OAUTH2_GITHUB_CLIENT_ID = " string"
Original file line number Diff line number Diff line change @@ -69,6 +69,14 @@ module.exports = configure(function (/* ctx */) {
69
69
CODESPACE_NAME : process . env . CODESPACE_NAME ,
70
70
GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN :
71
71
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 ,
72
80
...require ( "dotenv" ) . config ( ) . parsed ,
73
81
} ,
74
82
rawDefine : {
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export function loginWithGoogle() {
54
54
// Parameters to pass to OAuth 2.0 endpoint.
55
55
const params = {
56
56
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` ,
58
58
response_type : "id_token" ,
59
59
scope : "email profile openid" ,
60
60
nonce : "1" ,
@@ -72,7 +72,7 @@ export function loginWithGithub() {
72
72
// Parameters to pass to OAuth 2.0 endpoint.
73
73
const params = {
74
74
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` ,
76
76
scope : "read:user user:email" ,
77
77
}
78
78
Original file line number Diff line number Diff line change @@ -53,13 +53,7 @@ const watchFs = new WatcherFs()
53
53
const iframeLoading = ref (true )
54
54
// ====== /status ======
55
55
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 )
63
57
64
58
// eslint-disable-next-line functional/no-let
65
59
let listenerGetFile: null | (() => void ) = null
Original file line number Diff line number Diff line change @@ -3,10 +3,4 @@ export const isNative =
3
3
import . meta. env . MODE === "ios" ||
4
4
import . meta. env . MODE === "electron"
5
5
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
-
12
6
export 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 {
4
4
VUE_ROUTER_MODE : "hash" | "history" | "abstract" | undefined
5
5
VUE_ROUTER_BASE : string | undefined
6
6
API_URL : string
7
+ PREVIEW_URL : string
7
8
OAUTH2_GOOGLE_CLIENT_ID : string
8
9
OAUTH2_GITHUB_CLIENT_ID : string
9
10
}
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