Advertisement
Guest User

Untitled

a guest
Feb 8th, 2025
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. try{
  2. window.token = window.top.location.href.split('auth=')[1].split('&')[0]
  3. window.username = window.top.location.href.split('username=')[1].split('&')[0]
  4. } catch {}
  5. var url = ""
  6. for (x = 0; x < window.location.pathname.split("/").length - 2; x++) {
  7. var url = url + window.location.pathname.split("/")[x] + "/"
  8. }
  9. if (window.location.pathname.split("/")[window.location.pathname.split("/").length - 1].includes('.html')) {
  10. var title = window.location.pathname.split("/")[window.location.pathname.split("/").length - 1].split('.html')[0]
  11. } else {
  12. var title = window.location.pathname.split("/")[window.location.pathname.split("/").length - 2]
  13. }
  14. try {
  15. const token = window.top.location.href.split('auth=')[1].split('&')[0]
  16. const username = window.top.location.href.split('username=')[1].split('&')[0]
  17. fetch(`http://philh.myftp.biz:8000/login/Auth?username=${username}&auth=${token}`).then(r => r.json()).then(t => {
  18. if (!t) {
  19. window.top.location.href = '/_Account/Login?dest='+window.location.pathname+'&prev='+url
  20. }
  21. })
  22. } catch {
  23. window.top.location.href = '/_Account/Login?dest='+window.location.pathname+'&prev='+url
  24. }
  25.  
  26.  
  27. setInterval(() => {
  28. const token = window.top.location.href.split('auth=')[1].split('&')[0]
  29. const username = window.top.location.href.split('username=')[1].split('&')[0]
  30. fetch(`http://philh.myftp.biz:8000/login/Auth?username=${username}&auth=${token}`).then(r =>r.json()).then(t => {
  31. if (!t.valid) {
  32. alert('Your session has expired')
  33. window.top.location.href = '/_Account/Login?'+window.location.pathname
  34. }
  35. })
  36. }, 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement