Skip to content

Commit

Permalink
Remove jellyfin_credentials before loading iframe
Browse files Browse the repository at this point in the history
Due to Safari's aggressive caching updated jellyfin_credentials were not
used. They were overwritten with the old credentials instead. This fix
removes jellyfin_credentials first, then let's iframe load and create
new jellyfin_credentials with no access token. After this we update it
and login succeeds.
  • Loading branch information
sbogomolov authored and 9p4 committed Feb 10, 2024
1 parent 9be3e8e commit 5149cef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SSO-Auth/WebResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@ async function link(request) {
}
async function main() {
localStorage.removeItem('jellyfin_credentials');
document.getElementById('iframe-main').src = '" + baseUrl + @"/web/index.html';
var data = '" + data + @"';
while (localStorage.getItem(""_deviceId2"") == null ||
localStorage.getItem(""jellyfin_credentials"") == null ||
Expand Down Expand Up @@ -501,6 +504,6 @@ async function main() {
});
// https://stackoverflow.com/a/25435165
</script><iframe class='docs-texteventtarget-iframe' sandbox='allow-same-origin allow-forms allow-scripts' src='" + baseUrl + "/web/index.html' style='position: absolute;width:0;height:0;border:0;'></iframe></body></html>";
</script><iframe id='iframe-main' class='docs-texteventtarget-iframe' sandbox='allow-same-origin allow-forms allow-scripts' src='' style='position: absolute;width:0;height:0;border:0;'></iframe></body></html>";
}
}

0 comments on commit 5149cef

Please sign in to comment.