mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-21 14:51:45 +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"])
|
||||
def API_ValidateAuthentication():
|
||||
if DashboardConfig.GetConfig("Server", "auth_req")[1]:
|
||||
token = request.cookies.get("authToken") + ""
|
||||
if (token == "" or "username" not in session or session["username"] != token):
|
||||
token = request.cookies.get("authToken")
|
||||
if (token is None or token == "" or "username" not in session or session["username"] != token):
|
||||
return ResponseObject(False, "Invalid authentication.")
|
||||
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 {
|
||||
await dashboardConfigurationStore.getConfiguration()
|
||||
if (to.path === "/signin"){
|
||||
if (to.path === "/signin" && auth){
|
||||
next("/")
|
||||
}else{
|
||||
next()
|
||||
|
Loading…
Reference in New Issue
Block a user