Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirari04 committed Jan 8, 2024
1 parent c1aa1d6 commit 417e0f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 10 additions & 1 deletion controllers/PlayerController.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,16 @@ func PlayerController(c *fiber.Ctx) error {
log.Printf("Failed to generate jwt stream token: %v", err)
return c.SendStatus(fiber.StatusInternalServerError)
}

// "{{.UUID}}={{.JWT}}; path=/; domain=" + window.location.hostname + ";SameSite=None; Secure; HttpOnly"
c.Cookie(&fiber.Cookie{
Name: requestValidation.UUID,
Value: tkn,
Path: "/",
Secure: true,
SameSite: "none",
HTTPOnly: false,
SessionOnly: true,
})
return c.Render("player", fiber.Map{
"Title": fmt.Sprintf("%s - %s", config.ENV.AppName, dbLink.Name),
"Description": fmt.Sprintf("Watch %s on %s", dbLink.Name, config.ENV.AppName),
Expand Down
1 change: 0 additions & 1 deletion views/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@
if (Audios == null) Audios = [];
let Webhooks = JSON.parse(decodeURI("{{.Webhooks}}"));
if (Webhooks == null) Webhooks = [];
document.cookie = "{{.UUID}}={{.JWT}}; path=/; domain=" + window.location.hostname + ";SameSite=None; Secure; HttpOnly"
const UUID = "{{.UUID}}";
const PROJECTURL = "{{.PROJECTURL}}";
const TITLE = "{{.Title}}";
Expand Down

0 comments on commit 417e0f7

Please sign in to comment.