mirror of
https://github.com/nextcloud/twofactor_gateway.git
synced 2026-04-25 09:05:55 +03:00
[GH-ISSUE #226] Can't reactivate twofactor_gateway #52
Labels
No labels
0. to triage
1. to develop
3. to review
blocked
bug
discussion
duplicate
enhancement
enhancement
gateway:signal
gateway:signal
gateway:signal
gateway:sms
gateway:telegram
hacktoberfest
help wanted
invalid
needs info
php
pull-request
question
technical debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/twofactor_gateway-nextcloud#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @binford6000 on GitHub (Apr 17, 2019).
Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/226
I deactivated twofactor_gateway some days ago and wanted to reactivate it. When i enter my identification it says: "Could not verify your code. Please try again". This could be found in the log:
`[index] Error: UnexpectedValueException: Only integers, floats and strings are allowed as value at <>
setUserValue("admin", "twofactor_gateway", "telegram_chat_id", null)
getChatId(OC\User\User {}, Telegram\Bot\Api {}, 123456789)
send(OC\User\User {}, "123456789", "253871 is your ... .")
startSetup(OC\User\User {}, "telegram", "123456789")
startVerification("telegram", "123456789")
executeController(OCA\TwoFactorGat ... {}, "startVerification")
dispatch(OCA\TwoFactorGat ... {}, "startVerification")
main("OCA\TwoFactorG ... r", "startVerification", OC\AppFramework\ ... {}, {gateway: "teleg ... "})
__invoke({gateway: "teleg ... "})
call_user_func(OC\AppFramework\ ... {}, {gateway: "teleg ... "})
match("/apps/twofactor ... t")
handleRequest()
POST /apps/twofactor_gateway/settings/telegram/verification/start
from 91.67.178.10 by admin at 2019-04-17T19:28:16+00:00`
What can i do to reactivate twofactor_gateway?
Kind regards,
Sebastian
@ChristophWurst commented on GitHub (Apr 17, 2019):
Apparently an invalid value type is passed as parameter. I assume it is
null.In the case of Telegram this is a bit of a problem because the
/startmessage is only sent once.@ChristophWurst commented on GitHub (Apr 17, 2019):
This won't help solving your issue but it's a known bug/limitation:
github.com/nextcloud/twofactor_gateway@95f36e7bbf/lib/Service/Gateway/Telegram/Gateway.php (L104)@ChristophWurst commented on GitHub (Apr 17, 2019):
This is likely related to https://github.com/nextcloud/twofactor_gateway/issues/110. Unfortunately I have not found the time yet to work on that as this app is low on my priority list, so any help would be highly appreciated 🙌
@parreitu commented on GitHub (Apr 26, 2019):
Hi
I've made a test. I've edited the getChatId function of this file
https://github.com/nextcloud/twofactor_gateway/blob/95f36e7bbfaf2d04ffd3c3c3fa2b22352e20bf18/lib/Service/Gateway/Telegram/Gateway.php#L86
Replacing
$chatId = $this->config->getUserValue($user->getUID(), 'twofactor_gateway', 'telegram_chat_id', null);
by this line (suppose that 999999 is my chat_id)
$chatId = 999999
With this change, all is ok. I can configure the gateway, I get the verification code on my telegram APP , I can deactivate and activate again the twofactor_gateway, ..., all is OK.
All the problems related by @Dretech in this issue #110 appear to be solved.
So, in consequence, I think that the problem is in this line, it isn't getting the number (our chat_id) that we previously have introduced in the verify box
$chatId = $this->config->getUserValue($user->getUID(), 'twofactor_gateway', 'telegram_chat_id', null);
I don't know how to make this changes in PHP, but it could be a good clue to solve the issue.
@binford6000 commented on GitHub (Apr 26, 2019):
Hi parreitu,
that works for me, too! Made my day ;-)
Sebastian
@Dretech commented on GitHub (May 7, 2019):
Hello Parreitu,
You found the cause why the Telegram 2fa app is not working in Nextcloud. When I change the chatid by the way you described, the app is working! Thanks.
@ChristophWurst can you change line 86 of /lib/Service/Gateway/Telegram/Gateway.php in a way that this line uses the user id entered in the web interface?
Dretech
@ChristophWurst commented on GitHub (May 7, 2019):
It's on my todo!