mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-21 23:01:39 +01:00
Fixed auth req = false not working
This commit is contained in:
parent
6634c9170b
commit
40cad2637f
@ -1505,8 +1505,8 @@ def API_ValidateAPIKey():
|
|||||||
@app.route(f'{APP_PREFIX}/api/validateAuthentication', methods=["GET"])
|
@app.route(f'{APP_PREFIX}/api/validateAuthentication', methods=["GET"])
|
||||||
def API_ValidateAuthentication():
|
def API_ValidateAuthentication():
|
||||||
if DashboardConfig.GetConfig("Server", "auth_req")[1]:
|
if DashboardConfig.GetConfig("Server", "auth_req")[1]:
|
||||||
token = request.cookies.get("authToken") + ""
|
token = request.cookies.get("authToken")
|
||||||
if (token == "" or "username" not in session or session["username"] != token):
|
if (token is None or token == "" or "username" not in session or session["username"] != token):
|
||||||
return ResponseObject(False, "Invalid authentication.")
|
return ResponseObject(False, "Invalid authentication.")
|
||||||
return ResponseObject(True)
|
return ResponseObject(True)
|
||||||
|
|
||||||
|
2
src/static/app/dist/assets/index.js
vendored
2
src/static/app/dist/assets/index.js
vendored
File diff suppressed because one or more lines are too long
@ -164,7 +164,7 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
await dashboardConfigurationStore.getConfiguration()
|
await dashboardConfigurationStore.getConfiguration()
|
||||||
if (to.path === "/signin"){
|
if (to.path === "/signin" && auth){
|
||||||
next("/")
|
next("/")
|
||||||
}else{
|
}else{
|
||||||
next()
|
next()
|
||||||
|
Loading…
Reference in New Issue
Block a user