tylerbenson / vyllage

https://www.vyllage.com
4 stars 0 forks source link

Saving changes when session expires. #1006

Closed kalobkalob closed 9 years ago

kalobkalob commented 9 years ago

I was unable to save changes when editing my profile. Let the browser session expire through inactivity. Best thing would probably be a notification that the session has expired and the user needs to relogin.

nelonoel commented 9 years ago

Might be related to https://github.com/natebenson/vyllage/issues/454

tylerbenson commented 9 years ago

It's not a bad idea to have the front end display a banner notification when it stops pinging the back end.

nelonoel commented 9 years ago

Is the session meant to expire even if the front-end is pinging the back-end during inactivity? If so, we have to handle 401 errors across all front-end requests.

tylerbenson commented 9 years ago

I think the front end pings for up to one hour, so after that might be good...

kalobkalob commented 9 years ago

The problem wasn't the inability to save, it's the lack of any indication that the session has ended. This would lead the user to believe that the site is broken.

The main problem comes down to the page just refreshing and clearing any changes without any indication of anything wrong. Either notify that the session has expired or redirect to the login page.

nelonoel commented 9 years ago

Right. I think redirecting to the login page with the appropriate error message is best. Also, I was thinking it would be better if the back-end would handle the redirection upon session expiration. Just some thoughts.

UnspeakableHorror commented 9 years ago

When the session expires any action should redirect you to login, maybe the way we are posting prevents that?

tarex commented 9 years ago

on /account/ping request when it returns rather than 200 then we can just redirect it to logout .

tarex commented 9 years ago

@nelonoel how you want to show the messages on the login page after the redirection ?

UnspeakableHorror commented 9 years ago

You could just use the same message when the user logouts I think, check /logout's parameter to get it.

nelonoel commented 9 years ago

^ That. Maybe say something like: "Your session has expired. Please login to continue."

tylerbenson commented 9 years ago

And hope they don't have any unsaved changes?

tarex commented 9 years ago

for unsaved changes , we can use LocalStorage to store temp data and when its in resume page then we can check if it has temp data , then send it to the edit mode . @tylerbenson is there any other option we can use ?

tylerbenson commented 9 years ago

Haha, check out https://github.com/natebenson/vyllage/issues/453

It just hasn't been high enough priority to worry about. You think we should do it now?

tarex commented 9 years ago

we can do the LocalStorage part later . I'm changing the message .