check that period is positive value

This commit is contained in:
Kyle Spearrin 2018-07-31 11:35:04 -04:00
parent 41ab22a82f
commit ee13a562f9
1 changed files with 4 additions and 1 deletions

View File

@ -30,7 +30,10 @@ export class TotpService implements TotpServiceAbstraction {
}
if (params.has('period') && params.get('period') != null) {
try {
period = parseInt(params.get('period').trim(), null);
const periodParam = parseInt(params.get('period').trim(), null);
if (periodParam > 0) {
period = periodParam;
}
} catch { }
}
if (params.has('secret') && params.get('secret') != null) {