mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add checking token expiration time to TransactionLink.vue
This commit is contained in:
parent
8a8ffccd71
commit
0b7313d216
@ -103,6 +103,12 @@ export default {
|
||||
isContributionLink() {
|
||||
return this.$route.params.code.search(/^CL-/) === 0
|
||||
},
|
||||
tokenExpiresInSeconds() {
|
||||
const remainingSecs = Math.floor(
|
||||
(new Date(this.$store.state.tokenTime * 1000).getTime() - new Date().getTime()) / 1000,
|
||||
)
|
||||
return remainingSecs <= 0 ? 0 : remainingSecs
|
||||
},
|
||||
itemType() {
|
||||
// link is deleted: at, from
|
||||
if (this.linkData.deletedAt) {
|
||||
@ -130,7 +136,9 @@ export default {
|
||||
return `TEXT`
|
||||
}
|
||||
|
||||
if (this.$store.state.token) {
|
||||
if (this.$store.state.token && this.$store.state.tokenTime) {
|
||||
if (this.tokenExpiresInSeconds < 5) return `LOGGED_OUT`
|
||||
|
||||
// logged in, nicht berechtigt einzulösen, eigener link
|
||||
if (this.linkData.user && this.$store.state.email === this.linkData.user.email) {
|
||||
return `SELF_CREATOR`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user