Compare commits

...

1 Commits

Author SHA1 Message Date
Roeland Jago Douma cd59a855a1
No need for the use of moment in the password-confirmation
Cleaning them up one instance at a time.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-11 21:24:53 +02:00
7 changed files with 11 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,6 @@
import _ from 'underscore'
import $ from 'jquery'
import moment from 'moment'
import OC from './index'
@ -35,12 +34,12 @@ export default {
init: function() {
$('.password-confirm-required').on('click', _.bind(this.requirePasswordConfirmation, this))
this.pageLoadTime = moment.now()
this.pageLoadTime = Date.now()
},
requiresPasswordConfirmation: function() {
const serverTimeDiff = this.pageLoadTime - (window.nc_pageLoad * 1000)
const timeSinceLogin = moment.now() - (serverTimeDiff + (window.nc_lastLogin * 1000))
const timeSinceLogin = Date.now() - (serverTimeDiff + (window.nc_lastLogin * 1000))
// if timeSinceLogin > 30 minutes and user backend allows password confirmation
return (window.backendAllowsPasswordConfirmation && timeSinceLogin > 30 * 60 * 1000)