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