AutoLogout Component, watcher on lastAppInteraction
Summary
The Autologout Component is broken.
Instead of using mapState. store.getters.state.lastAppInteraction
should be used for a typed interface.
As it stands, the component declares a method lastAppInteraction()
that contained the old token refreshing logic. Another method watch()
is declared that calls lastAppInteraction()
.
There is no watcher created that watches the store value of lastAppInteraction
Steps to reproduce
Example Project
What is the current bug behavior?
The logic for refreshing the JWT is contained in a simple method on the AutoLogout Comp.
What is the expected correct behavior?
It should be called upon changes to store.getters.state.lastAppInteraction
Relevant logs and/or screenshots
Possible fixes
Declare a computed property, prefixed with get
, that returns store.getters.state.lastAppInteraction
. Declare a watcher on that computed property via vue-property-decorator that contains the logic of the current lastAppInteraction()
method.