Token stats fix
This commit is contained in:
parent
f207092294
commit
18880905df
|
@ -84,9 +84,13 @@ const Query = {
|
||||||
tokenCountUsed: prisma.resetToken.count({
|
tokenCountUsed: prisma.resetToken.count({
|
||||||
where: { NOT: { usedAt: null } }
|
where: { NOT: { usedAt: null } }
|
||||||
}),
|
}),
|
||||||
tokenCountExpired: 0,
|
tokenCountExpired: prisma.resetToken.count({
|
||||||
|
where: {
|
||||||
|
AND: [{ expiration: { lt: new Date() } }, { usedAt: null }]
|
||||||
|
}
|
||||||
|
}),
|
||||||
tokenCountNotUsed: prisma.resetToken.count({
|
tokenCountNotUsed: prisma.resetToken.count({
|
||||||
where: { usedAt: null }
|
where: { usedAt: null, expiration: { gt: new Date() } }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,7 +6,9 @@ const ResetToken = {
|
||||||
},
|
},
|
||||||
user(_) {
|
user(_) {
|
||||||
return prisma.resetToken.findOne({ where: { id: _.id } }).user()
|
return prisma.resetToken.findOne({ where: { id: _.id } }).user()
|
||||||
}
|
},
|
||||||
|
expiration: _ => _.expiration.toISOString(),
|
||||||
|
createdAt: _ => _.createdAt.toISOString()
|
||||||
}
|
}
|
||||||
|
|
||||||
export { ResetToken }
|
export { ResetToken }
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
<v-icon>mdi-clock-outline</v-icon>
|
<v-icon>mdi-clock-outline</v-icon>
|
||||||
</v-list-item-avatar>
|
</v-list-item-avatar>
|
||||||
<v-list-item-content>
|
<v-list-item-content>
|
||||||
<v-list-item-title> Tokens ainda não usados </v-list-item-title>
|
<v-list-item-title> Tokens aguardando uso </v-list-item-title>
|
||||||
<v-list-item-subtitle>
|
<v-list-item-subtitle>
|
||||||
{{ stats.tokenCountNotUsed }}
|
{{ stats.tokenCountNotUsed }}
|
||||||
</v-list-item-subtitle>
|
</v-list-item-subtitle>
|
||||||
|
|
|
@ -12,4 +12,4 @@ Vue.filter('from', val =>
|
||||||
formatDistance(new Date(val), Date.now(), { locale, addSuffix: true })
|
formatDistance(new Date(val), Date.now(), { locale, addSuffix: true })
|
||||||
)
|
)
|
||||||
|
|
||||||
Vue.filter('time', val => format(new Date(val), 'HH:MM', { locale }))
|
Vue.filter('time', val => format(new Date(val), 'HH:MM', { locale }))
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</v-card>
|
</v-card>
|
||||||
<div class="text-center font-weight-light mt-5">
|
<div class="text-center font-weight-light mt-5">
|
||||||
Válido até
|
Válido até
|
||||||
{{ tokenInfo.expiration | dateAndtime }}
|
{{ tokenInfo.expiration | dateAndTime }}
|
||||||
</div>
|
</div>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
<v-list dense class="font-weight-light text-justify">
|
<v-list dense class="font-weight-light text-justify">
|
||||||
<v-list-item>
|
<v-list-item>
|
||||||
<v-list-item-avatar>
|
<v-list-item-avatar>
|
||||||
<v-icon>mdi-account-card-details</v-icon>
|
<v-icon>mdi-card-account-details</v-icon>
|
||||||
</v-list-item-avatar>
|
</v-list-item-avatar>
|
||||||
<v-list-item-content>
|
<v-list-item-content>
|
||||||
Após cadastrar sua nova senha, utilize seu CPF como login.
|
Após cadastrar sua nova senha, utilize seu CPF como login.
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
<v-list-item>
|
<v-list-item>
|
||||||
<v-list-item-avatar>
|
<v-list-item-avatar>
|
||||||
<v-icon>mdi-textbox-password</v-icon>
|
<v-icon>mdi-form-textbox-password</v-icon>
|
||||||
</v-list-item-avatar>
|
</v-list-item-avatar>
|
||||||
<v-list-item-content>
|
<v-list-item-content>
|
||||||
A senha é de responsabilidade do usuário e não deve ser
|
A senha é de responsabilidade do usuário e não deve ser
|
||||||
|
|
Loading…
Reference in New Issue
Block a user