mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-06-28 09:16:55 +00:00
Update
This commit is contained in:
parent
8a77fbfefd
commit
93a23671e4
@ -150,6 +150,7 @@ def API_AuthenticateLogin():
|
|||||||
|
|
||||||
if DashboardConfig.APIAccessed:
|
if DashboardConfig.APIAccessed:
|
||||||
authToken = hashlib.sha256(f"{request.headers.get('wg-dashboard-apikey')}{datetime.now()}".encode()).hexdigest()
|
authToken = hashlib.sha256(f"{request.headers.get('wg-dashboard-apikey')}{datetime.now()}".encode()).hexdigest()
|
||||||
|
session['role'] = 'admin'
|
||||||
session['username'] = authToken
|
session['username'] = authToken
|
||||||
resp = ResponseObject(True, DashboardConfig.GetConfig("Other", "welcome_session")[1])
|
resp = ResponseObject(True, DashboardConfig.GetConfig("Other", "welcome_session")[1])
|
||||||
resp.set_cookie("authToken", authToken)
|
resp.set_cookie("authToken", authToken)
|
||||||
@ -167,6 +168,7 @@ def API_AuthenticateLogin():
|
|||||||
and ((totpEnabled and totpValid) or not totpEnabled)
|
and ((totpEnabled and totpValid) or not totpEnabled)
|
||||||
):
|
):
|
||||||
authToken = hashlib.sha256(f"{data['username']}{datetime.now()}".encode()).hexdigest()
|
authToken = hashlib.sha256(f"{data['username']}{datetime.now()}".encode()).hexdigest()
|
||||||
|
session['role'] = 'admin'
|
||||||
session['username'] = authToken
|
session['username'] = authToken
|
||||||
resp = ResponseObject(True, DashboardConfig.GetConfig("Other", "welcome_session")[1])
|
resp = ResponseObject(True, DashboardConfig.GetConfig("Other", "welcome_session")[1])
|
||||||
resp.set_cookie("authToken", authToken)
|
resp.set_cookie("authToken", authToken)
|
||||||
@ -1190,14 +1192,11 @@ def peerInformationBackgroundThread():
|
|||||||
with app.app_context():
|
with app.app_context():
|
||||||
for c in WireguardConfigurations.values():
|
for c in WireguardConfigurations.values():
|
||||||
if c.getStatus():
|
if c.getStatus():
|
||||||
# try:
|
|
||||||
c.getPeersTransfer()
|
c.getPeersTransfer()
|
||||||
c.getPeersLatestHandshake()
|
c.getPeersLatestHandshake()
|
||||||
c.getPeersEndpoint()
|
c.getPeersEndpoint()
|
||||||
c.getPeersList()
|
c.getPeersList()
|
||||||
c.getRestrictedPeersList()
|
c.getRestrictedPeersList()
|
||||||
# except Exception as e:
|
|
||||||
# print(f"[WGDashboard] Background Thread #1 Error: {str(e)}", flush=True)
|
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
def peerJobScheduleBackgroundThread():
|
def peerJobScheduleBackgroundThread():
|
||||||
|
@ -160,7 +160,6 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
}
|
}
|
||||||
dashboardConfigurationStore.Redirect = undefined;
|
dashboardConfigurationStore.Redirect = undefined;
|
||||||
next()
|
next()
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
dashboardConfigurationStore.Redirect = to;
|
dashboardConfigurationStore.Redirect = to;
|
||||||
next("/signin")
|
next("/signin")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user