Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session expired modal #933

Merged
merged 18 commits into from
Dec 3, 2023
Merged

Conversation

yokwejuste
Copy link
Collaborator

@yokwejuste yokwejuste commented Oct 20, 2023

Summary

Description of PR here...
Closes #906

Changes

  • New component for the session expiration
  • Removing the toast for expired token and dispatching the Expiration component

Screenshots

Progress


image

image

image

image

@yokwejuste yokwejuste marked this pull request as draft October 20, 2023 20:18
Copy link
Collaborator

@coderatomy coderatomy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, nice work so far. Revert the rest apart from sessionExpired and it's jss. Also rename it to sessionExpiredModal

Simply create a new route called session-update or anything better and link it to this component.
Then inside a useEffect in either App.js or PageWrapper.jsx you redirect to this route once the token is expired.
Let's see how that goes

Am still looking for a replacement of this useEffect. It's not as fast as we would want it to be

zubhub_frontend/zubhub/src/store/actions/authActions.js Outdated Show resolved Hide resolved
zubhub_frontend/zubhub/src/views/PageWrapper.jsx Outdated Show resolved Hide resolved
zubhub_frontend/zubhub/src/store/actions/authActions.js Outdated Show resolved Hide resolved
@yokwejuste yokwejuste marked this pull request as ready for review October 20, 2023 22:38
@yokwejuste
Copy link
Collaborator Author

Hey @srish @DonPresh @coderatomy here is the look of the result of the implementation.

Please I'll like a review on this.

cc: @tuxology @aqsaaqeel @brrkrmn

@coderatomy
Copy link
Collaborator

coderatomy commented Oct 22, 2023

Hey @yokwejuste, please note my comment above and in the issue description. They contain a clear workaround this issue plus the reasons why. If you wouldn't like to follow that pattern, please provide a proper explanation for this approach wrapping all different scenarios and we see the way forward

For the design, please also note the blurred background and it is actually better that way, thanks to @DonPresh's design integrity. That's why I insist on calling it SessionExpiredModal than SessionExpiredCard

@yokwejuste
Copy link
Collaborator Author

Hey @yokwejuste, please note my comment above and in the issue description. They contain a clear workaround this issue plus the reasons why. If you wouldn't like to follow that pattern, please provide a proper explanation for this approach wrapping all different scenarios and we see the way forward

For the design, please also note the blurred background and it is actually better that way, thanks to @DonPresh's design integrity

Thanks for this @coderatomy, I'm jumping on to this today. :)

overflow: 'hidden',
},
cardHeader: {
backgroundColor: '#f44336',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use color from theme

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This color is left. This should be our primary color red

@tuxology
Copy link
Member

@yokwejuste I have left a few comments on the design. Also how does this look in responsive mode? I think we need some uniformity in the design across the site. Please try to use as many standard MUI components as possible which we can then theme.

@yokwejuste
Copy link
Collaborator Author

@yokwejuste I have left a few comments on the design. Also how does this look in responsive mode? I think we need some uniformity in the design across the site. Please try to use as many standard MUI components as possible which we can then theme.

Got it, thanks,

I'm on it right now

@yokwejuste
Copy link
Collaborator Author

updates with different screen responsiveness

image
image
image
image

Copy link
Collaborator

@NdibeRaymond NdibeRaymond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few comments mostly about proper translation. Nice work @yokwejuste !

@coderatomy
Copy link
Collaborator

FYI @tuxology @NdibeRaymond @yokwejuste. Since #931 we are recording the initialUrl in the localStorage before logging out and then redirect the user to it after logging in. So I think here the user will be redirected to /session-expired after logging in.
We can use regex to ignore recording this url but a better solution would be to record the url before routing to the session modal, then use that instead.

I haven't tested this PR locally yet, but I believe that will be the experience

Copy link
Member

@tuxology tuxology left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one minor comment. Also please check comment from @coderatomy about the session-expired route issue #933 (comment) Can you test it and let me know if this is the case? If yes, lets fix it.

overflow: 'hidden',
},
cardHeader: {
backgroundColor: '#f44336',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This color is left. This should be our primary color red

@tuxology
Copy link
Member

@yokwejuste Also, we've left the svg. Lets remove this #933 (comment)

@yokwejuste
Copy link
Collaborator Author

@tuxology I think it looks good now

Copy link
Member

@tuxology tuxology left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now 🌈

@tuxology tuxology merged commit c699ad5 into unstructuredstudio:master Dec 3, 2023
coderatomy added a commit to coderatomy/zubhub that referenced this pull request Dec 5, 2023
coderatomy added a commit to coderatomy/zubhub that referenced this pull request Dec 5, 2023
tuxology added a commit that referenced this pull request Dec 20, 2023
tuxology added a commit that referenced this pull request Dec 20, 2023
This reverts commit c699ad5 since it breaks UX. We will bring it back later
coderatomy added a commit that referenced this pull request Dec 20, 2023
coderatomy added a commit that referenced this pull request Dec 21, 2023
brrkrmn added a commit that referenced this pull request Dec 28, 2023
coderatomy added a commit that referenced this pull request Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users should be instantly redirected to the login page once their auth token expires
4 participants