Closed kgardnr closed 6 years ago
@kgardnr I'd like to tackle this issue.
Great @Goyapa, we'd love to have your help with this!
Hello @kgardnr, what I have found:
Client: Toast and default pym used. Server: Passport and json web token(jwt).
On the client I found info(msg)?
/talk/client/coral-admin/src/services/notification.js
export function createNotificationService(toast) {
return {
success(msg) {
toast(msg, {type: 'success'});
},
error(msg) {
toast(msg, {type: 'error'});
},
info(msg) {
toast(msg, {type: 'info'});
},
};
}
Actually I see only fragments and do not see the whole picture, could I get some more info please.
Ok great - so I think what you wanna do is detect if a session has expired for the current user, right? And then use the notification service to deliver an error message.
What I found is that sessions expires after 24 hours. For current user I'm not sure where to look at. Can you point me in the right direction? Actually I try at talk/client/coral-admin/src/actions/auth.js but than i have to import
import {toast} from 'react-toastify';
import {createNotificationService} from '../services/notification.js';
do not think that is the right way?
@cvle with JWT debugger I am able to change "exp" and see the following errors in console. So, set reproduceable "exp" time works as expected.
I hoped to get an error pointing me to the users "exp" settings. Is this implemented jet? But the last times I asked, it actually was... I got stuck and need some more information.
The exp
claim is the definition of when the user would be logged out with that token. My suggestion, set a timeout for when that expiry time is reached to display some sort of UI reflecting the fact that their user session has expired, and prompt them to login again.
Ok, thank you @wyattjoh for your suggestion, i'm onto it again!
Hey @Goyapa if you still wants to work on this, just make sure you follow the upgrade instructions for v4.0.0: https://coralproject.github.io/talk/migration/4/
Fixed in v5.
Story: As a moderator, I want to know when my admin session has expired so I don't try and take actions that won't save