antonioribeiro / antonioribeiro/google2fa-php

Extend OTP duration

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
9
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Hello,
is it possible to extend the OTP lifetime?
In my scenario I need to email or text the current OTP without forcing the user to install Google Authenticator for example.

```php
$google = new PragmaRX\Google2FA\Google2FA();
$otp = $google->getCurrentOtp(decrypt(Auth()->user()->two_factor_secret));
// email the code to the user
```

The problem is that by the time the user has received the email opened it, copied the code etc, the OTP is already expired in most cases. So is it possible to extend its lifetime before it expires?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the PHP class entry point shown in the issue, getCurrentOtp(), and trace how the OTP lifetime is calculated. Determine whether the requested delivery delay can be supported without breaking authenticator compatibility, then define and test the behavior for an extended lifetime.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.