Skip to content

Commit

Permalink
fix(auth): add expired at in update time
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l committed Mar 11, 2024
1 parent b67eb45 commit ce2dbef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions functions/lib/bling-auth/create-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ module.exports = function (clientId, clientSecret, code, storeId, tokenExpiratio
clientId,
clientSecret,
updatedAt: now,
expiredAt: now // Timestamp.fromMillis(now.toMillis() + (2 * 60 * 60 * 1000))
expiredAt: Timestamp.fromMillis(now.toMillis() + (2 * 60 * 60 * 1000))
}
console.log('>>> expiredAt: ', body.expiredAt.toDate(), ' ', now.toDate(), ' ')

if (code) {
body.code = code
}
Expand Down
4 changes: 1 addition & 3 deletions functions/routes/bling/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ exports.get = async ({ appSdk, admin }, req, res) => {
console.log('Pass variables', JSON.stringify({ clienteId, clientSecret, code, storeId }))
const bling = new Bling(clienteId, clientSecret, code, storeId)
await bling.preparing
setTimeout(() => {
return res.status(200).redirect('https://app.e-com.plus/#/apps/edit/102418/')
}, 4000)
return res.status(200).redirect('https://app.e-com.plus/#/apps/edit/102418/')
})
} catch (error) {
console.error(error)
Expand Down

0 comments on commit ce2dbef

Please sign in to comment.