donaldzou / WGDashboard

Simple dashboard for WireGuard VPN written in Python & Vue.js
https://donaldzou.github.io/WGDashboard-Documentation/
Apache License 2.0
1.63k stars 248 forks source link

After updating WGDashboard to version 4.1.0, it is no longer possible to log in. #509

Closed eje-1 closed 1 day ago

eje-1 commented 1 day ago

Describe The Problem After updating WGDashboard to version 4.1.0, it is no longer possible to log in. An error is raised when attempting to authenticate.

Expected Error / Traceback

[2024-11-20 16:13:31,271] ERROR in app: Exception on /api/authenticate [POST]
Traceback (most recent call last):
  File "/opt/wgdashboard/src/venv/lib/python3.12/site-packages/flask/app.py", line 1511, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/wgdashboard/src/venv/lib/python3.12/site-packages/flask/app.py", line 919, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/wgdashboard/src/venv/lib/python3.12/site-packages/flask_cors/extension.py", line 194, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "/opt/wgdashboard/src/venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/wgdashboard/src/venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/wgdashboard/src/dashboard.py", line 1727, in API_AuthenticateLogin
    valid = bcrypt.checkpw(data['password'].encode("utf-8"),
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Invalid salt

To Reproduce

  1. Update WGDashboard to version 4.0.1.
  2. Start the application: ./wgd.sh start.
  3. Try to log in with the default credentials (e.g., username: admin, password: admin).
  4. The above traceback is generated, and login is unsuccessful.

OS Information:

In this version v3.0.6 everything was good. Many thanks in advance!

DaanSelen commented 1 day ago

Did you come from any version before 4.0.x? If yes, remove the password field from the wg-dashboard.ini?

eje-1 commented 1 day ago

Yes, I came from a version prior to 4.0.x. I removed the password field from wg-dashboard.ini and then ran ./wgd.sh restart. Now everything is working fine! Thanks DannSelen!