-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"window.reese84 is undefined" when logging in #13
Comments
Adding a message to notice that https://f1tokenx.deta.dev/ displays now "Service No Longer Available" |
yep, deta is now down. i'm considering deploying elsewhere |
Is this a component that we could also self-host? Is the source code for what used to be running on deta publicly available? Essentially, I guess what I'm asking is, is there a way for us to host everything on our own servers so we don't have to rely on third-party services? |
Maybe config file to place the token in or a token login field. |
At a second glance, it looks like that deta instance was proxying requests to https://api.formula1.com/6657193977244c13... |
Yep, that's planned, but I'm pretty busy previously but the all-in-one thing should work before next GP |
Music to my ears, thanks mate. I have hacked together something and it's working for today. If it's of any help to anyone else, this is what I have running on a domain from freedns to rewrite the URL and a couple of headers. from flask import Flask, request
from flask_cors import CORS
import requests
import logging
import sys
app = Flask(__name__)
CORS(app)
API_HOST="https://api.formula1.com/6657193977244c13?d=account.formula1.com"
@app.route('/6657193977244c13', methods=["GET"])
def getjs():
return requests.get("https://api.formula1.com/6657193977244c13").text
@app.route('/6657193977244c13', methods=["POST"])
def rewrite():
app.logger.debug(request.headers)
headers = {k:v for k,v in request.headers if k.lower() != 'host'}
headers['Origin'] = "https://account.formula1.com"
headers['Referer'] = "https://account.formula1.com/"
res = requests.request(
method = "POST",
url = API_HOST,
headers = headers,
data = request.get_data(),
cookies = request.cookies,
allow_redirects = False,
)
return res.text, res.status_code
if __name__ == "__main__":
app.run() I'm sure it's doable in express & node-fetch but I couldn't get the raw data from a request in time for the GP today so I just did it in python Flask which I'm much more comfortable with! |
for quick fix: https://github.com/iebb/F1WebViewer-SelfHosted/releases/tag/v0.2.1 check this, it should work |
Niiiiiice thanks @iebb ! I will deploy that after this GP and report back 🤞 |
@iebb thank you works, so i can run it on LG webos Browser :) |
Hello, I can confirm that, as of today, the message pops up once again. |
christovic's Script above works, when you self host the F1-Web-Viewer and the Script. Python and the modules flask, flask_cors and requests are required to run the script. The following variable is required to build F1-Web-Viewer with current nodejs |
I ended up writing my own F1 viewer that handles the login process a bit smoother than this one, but it's not as feature rich. Super simple static page - it's a bit lighter on resources and just automatically loads and plays the live GP if there is one. In this, I ended up writing a reese84 handler in golang, dropping here too if it is useful for anyone else: func reeseHandler(w http.ResponseWriter, r *http.Request) {
if r.Method == "GET" {
resp, err := http.Get("https://api.formula1.com/6657193977244c13")
if err != nil {
upstreamF1TVApiError(err, w)
return
}
body, err := io.ReadAll(resp.Body)
if err != nil {
upstreamF1TVApiError(err, w)
return
}
w.Write(body)
} else if r.Method == "POST" {
proxyReq, err := http.NewRequest(r.Method, "https://api.formula1.com/6657193977244c13?d=account.formula1.com", r.Body)
if err != nil {
http.Error(w, "Error creating proxy request", http.StatusInternalServerError)
return
}
for name, values := range r.Header {
for _, value := range values {
proxyReq.Header.Add(name, value)
}
}
proxyReq.Header.Add("Origin", "https://account.formula1.com")
proxyReq.Header.Add("Referer", "https://account.formula1.com")
resp, err := http.DefaultClient.Do(proxyReq)
if err != nil {
upstreamF1TVApiError(err, w)
return
}
upstreamBody, err := io.ReadAll(resp.Body)
if err != nil {
upstreamF1TVApiError(err, w)
return
}
w.Write(upstreamBody)
}
}
func upstreamF1TVApiError(err error, w http.ResponseWriter) {
log.Println(err)
http.Error(w, "Error from api.formula1.com", http.StatusBadGateway)
} |
I'm using latest exec.
As soon as I enter email and password, a message pops in red "window.reese84 is undefined". See hereby screenshot, and Console logs.
Uncaught (in promise) TypeError: window.reese84 is undefined
authenticate index.js:117
w vuex.esm.js:851
dispatch vuex.esm.js:516
dispatch vuex.esm.js:406
submit Login.vue:90
submit Login.vue:1
VueJS 3
https://pixheb.ovh/images/a4a40a8a21bd2cf08a185fc1e1122f8d.png
The text was updated successfully, but these errors were encountered: