Comments (9)
I solved the access to ucp.php changing the line 64 of src/phpMyFAQ/User/TwoFactor.php to:
return is_null($user->getUserData('secret')) ? '' : $user->getUserData('secret');
from phpmyfaq.
I just saw that this issue concerns "my" function and checked it:
Probably, you just have to change line 54 in ucp.php to
if (is_null($secret)) {
This is because the default value for secret in the db is set to null in the update script. @thorsten
But I can't test it currently...
from phpmyfaq.
Today, after logout, i cannot login anymore.
I tried to reset password, and with new password neither.
I tried change the line
try {
to
if (is_null($secret)) {
but cannot login to phpMyFAQ.
Thanks u
from phpmyfaq.
@albertcd Did you enabled 2FA? What is shown if you log in to your phpMyFAQ instance? Any error messages, maybe if you turn on DEBUG?
from phpmyfaq.
Today, after logout, i cannot login anymore. I tried to reset password, and with new password neither.
I tried change the line
try {
toif (is_null($secret)) {
but cannot login to phpMyFAQ.
Thanks u
That's wrong, it's my fault, I'm sorry. With your version of the database, you have to change line 53 in ucp.php to the line above, so:
if ($secret === '') {
to if (is_null($secret)) {
This should fix viewing ucp.php.
But this can't be the solution why you can't log in, so please answer my last questions too
from phpmyfaq.
Today, after logout, i cannot login anymore. I tried to reset password, and with new password neither.
I tried change the linetry {
toif (is_null($secret)) {
but cannot login to phpMyFAQ.
Thanks uThat's wrong, it's my fault, I'm sorry. With your version of the database, you have to change line 53 in ucp.php to the line above, so:
if ($secret === '') {
toif (is_null($secret)) {
This should fix viewing ucp.php. But this can't be the solution why you can't log in, so please answer my last questions too
I changed the line 52, now i have this lines:
$tfa = new TwoFactor($faqConfig);
$secret = $tfa->getSecret(CurrentUser::getFromSession($faqConfig));
if (is_null($secret)) {
try {
$secret = $tfa->generateSecret();
Now i can logging into phpMyFAQ (i don't understand why now is working, and this morning say "Bad user/password") and when i access to ucp, i get this error:
Uncaught exception: 'TypeError'
Message: 'phpMyFAQ\User\TwoFactor::getSecret(): Return value must be of type string, null returned'
Stack trace:
#0 /var/www/vhosts/domain.com/kb.domain.com/ucp.php(52): phpMyFAQ\User\TwoFactor->getSecret()
#1 /var/www/vhosts/domain.com/kb.domain.com/index.php(793): require('...')
#2 {main}
Thrown in '/var/www/vhosts/domain.com/kb.domain.com/src/phpMyFAQ/User/TwoFactor.php' on line 64
from phpmyfaq.
In general, I understand, why this error comes up, but I'm wondering why my test worked properly a few minutes ago...
Anyway, I'll propose you a change tomorrow, now I'm off work.
from phpmyfaq.
Yeah, you can do it like that, but alternatively, you should be able to change this line
public function getSecret(CurrentUser $user): string
to
public function getSecret(CurrentUser $user): string|null
in Twofactor.php as well.
from phpmyfaq.
Fixed with #2521
from phpmyfaq.
Related Issues (20)
- Category breadcrumbs broken HOT 1
- View-Password-Buttons HOT 6
- Backup from adminmenu not working HOT 3
- Categories Image uploader throws error HOT 1
- 4.0: No # in faq name HOT 2
- Error after upgrade to version 3.2.0 HOT 2
- Images using FQDN links do not work -- manually modifying to relative makes images work HOT 1
- Paste images from office documents not working. HOT 3
- User is not properly inititated in SSO login
- Syntax Error with MS365 Login HOT 9
- Theming improvements HOT 1
- 3.2.0 Registration Broken HOT 7
- Creating new question not working HOT 4
- TinyMce TOC plugin not working on 3.1 and not available on 3.2 HOT 4
- Fatal error on search
- Images loading via HTTPS when the site is just HTTP HOT 6
- Login error on the site HOT 9
- Add timeout for API-request
- Kein Login mehr als Administrator HOT 23
- Edition FAQ and add picture issue HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpmyfaq.