mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
Pass API origin to apps
This commit is contained in:
parent
fc5bdf6115
commit
fe0cd891e1
@ -1932,7 +1932,6 @@ window.launch_app = async (options)=>{
|
|||||||
iframe_url.searchParams.append('puter.item.name', options.filename);
|
iframe_url.searchParams.append('puter.item.name', options.filename);
|
||||||
iframe_url.searchParams.append('puter.item.path', options.file_path ? `~/` + options.file_path.split('/').slice(1).join('/') : undefined);
|
iframe_url.searchParams.append('puter.item.path', options.file_path ? `~/` + options.file_path.split('/').slice(1).join('/') : undefined);
|
||||||
iframe_url.searchParams.append('puter.item.read_url', options.readURL);
|
iframe_url.searchParams.append('puter.item.read_url', options.readURL);
|
||||||
// iframe_url.searchParams.append('puter.item.write_url', file_signature.write_url);
|
|
||||||
iframe_url.searchParams.append('puter.domain', window.app_domain);
|
iframe_url.searchParams.append('puter.domain', window.app_domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1948,6 +1947,9 @@ window.launch_app = async (options)=>{
|
|||||||
iframe_url.searchParams.append('puter.auth.token', options.token);
|
iframe_url.searchParams.append('puter.auth.token', options.token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(api_origin)
|
||||||
|
iframe_url.searchParams.append('puter.api_origin', api_origin);
|
||||||
|
|
||||||
// Try to acquire app token from the server
|
// Try to acquire app token from the server
|
||||||
else{
|
else{
|
||||||
let response = await fetch(window.api_origin + "/auth/get-user-app-token", {
|
let response = await fetch(window.api_origin + "/auth/get-user-app-token", {
|
||||||
|
Loading…
Reference in New Issue
Block a user