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>
This commit is contained in:
Roeland Jago Douma 2020-05-11 21:24:53 +02:00
parent 68b2102062
commit cd59a855a1
No known key found for this signature in database
GPG Key ID: F941078878347C0C
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)