🐛 (src/): fix logout function - #33
Draft
ncvescera wants to merge 5 commits into
Draft
Conversation
Used the 'clear' method to empty the Flask session. Updated the Vault endpoint path to revoke token.
These changes should allow for cleaning the Flask session when the browser is closed and performing a logout from Vault.
Added a GET request after the flask cleaning session function. This should force Vault to logout user.
Now the "start computing" button is displayed in the correct position.
Member
Author
|
Maybe using the Flask # Revoke the Vault token - We can't Batch token cannot be revoked
# Redirect the user to the identity provider logout URL
redirect('http://10.9.245.2:8200/ui/vault/logout')
# Clear session or cookies
session.clear()
return redirect('/') |
Member
Author
|
Set @app.route('/login')
def login():
# Add 'max_age' in the params for the OIDC request
redirect_uri = url_for('auth_callback', _external=True)
return oauth.my_oidc.authorize_redirect(
redirect_uri,
params={
'max_age': 3600, # Maximum session age in seconds (e.g., 1 hour)
'prompt': 'login' # Force re-authentication
}
)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes should allow for a correct user disconnection, both when they use the 'logout' button and when they close the browser. Once disconnected, the user should be forced to also disconnect automatically from Vault.
Fixed a problem with the 'Start Computing' button (#32), it's now displayed on screen correctly.