mirror of
https://github.com/HeyPuter/puter
synced 2024-11-15 06:15:47 +00:00
Merge branch 'main' into main
This commit is contained in:
commit
1b72b80241
@ -1955,23 +1955,20 @@ window.launch_app = async (options)=>{
|
|||||||
iframe_url.searchParams.append('puter.domain', window.app_domain);
|
iframe_url.searchParams.append('puter.domain', window.app_domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (app_info.godmode && app_info.godmode === 1){
|
||||||
// Add auth_token to GODMODE apps
|
// Add auth_token to GODMODE apps
|
||||||
if(app_info.godmode && app_info.godmode === 1){
|
|
||||||
iframe_url.searchParams.append('puter.auth.token', auth_token);
|
iframe_url.searchParams.append('puter.auth.token', auth_token);
|
||||||
iframe_url.searchParams.append('puter.auth.username', window.user.username);
|
iframe_url.searchParams.append('puter.auth.username', window.user.username);
|
||||||
iframe_url.searchParams.append('puter.domain', window.app_domain);
|
iframe_url.searchParams.append('puter.domain', window.app_domain);
|
||||||
}
|
} else if (options.token){
|
||||||
// App token. Only add token if it's not a GODMODE app since GODMODE apps already have the super token
|
// App token. Only add token if it's not a GODMODE app since GODMODE apps already have the super token
|
||||||
// that has access to everything.
|
// that has access to everything.
|
||||||
else if(options.token){
|
|
||||||
iframe_url.searchParams.append('puter.auth.token', options.token);
|
iframe_url.searchParams.append('puter.auth.token', options.token);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
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{
|
|
||||||
let response = await fetch(window.api_origin + "/auth/get-user-app-token", {
|
let response = await fetch(window.api_origin + "/auth/get-user-app-token", {
|
||||||
"headers": {
|
"headers": {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
@ -1986,6 +1983,9 @@ window.launch_app = async (options)=>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(api_origin)
|
||||||
|
iframe_url.searchParams.append('puter.api_origin', api_origin);
|
||||||
|
|
||||||
// Add options.params to URL
|
// Add options.params to URL
|
||||||
if(options.params){
|
if(options.params){
|
||||||
iframe_url.searchParams.append('puter.domain', window.app_domain);
|
iframe_url.searchParams.append('puter.domain', window.app_domain);
|
||||||
|
Loading…
Reference in New Issue
Block a user