project-rainstorm / rainstorm

The easiest way to own your cloud. Your data. Your cloud. Rainstorm.
Other
10 stars 5 forks source link

Implement JWT Refresh Token #100

Closed asharron closed 3 years ago

asharron commented 3 years ago

What was done

How To Test

  1. Checkout the branch on your pi
  2. Within your python virutal env, run pip3 install -r requriements.txt again to download flask_jwt_extended
  3. Edit line 24 of init.py for the flask server to be 5 seconds instead of 900 (so you don't have to wait 15 min to verify the refresh logic)
    JWT_ACCESS_TOKEN_EXPIRES=timedelta(seconds=900),  # 15 min
  4. Start FED and BED dev servers
  5. Logout on the frontend (in case you already have an access_token stored)
  6. Login using the drop user name and password
  7. Wait 5 seconds
  8. Hit refresh
  9. You should still be logged in
  10. Verify the server logs show you were unauthenticated but it automatically refreshed your access_token

image

nullcount commented 3 years ago

Closes #78 #87 #86 #101

nullcount commented 3 years ago

I added some commits to enable changing password. Also styled the login page a bit. Added nice alerts to indicate errors, success in the login and change password process.