2fauth - how to start using it?

What type of hardware are you using: Virtual machine
What YunoHost version are you running: 12.0.17 (stable)
What app is this about: 2fauth

Describe your issue

Hi all,

I used to use 2fauth to manage my 2nd factors. Unfartunately, the saved 2FA’s disappeared after one of the updates. I have rolled back a couple of times, until I forgot to do that and a subsequent upgrade overwrote the working backup with an empty backup.

No problem, I thought, I’ll just import the codes from a backup. That did not work (nothing happens when importing the file).

Now I completely removed the app and reinstalled it, only to find that I can not log in at all.

I can’t remember what the procedure was when I first installed; this time when installing I had to chose an “admin user email address”. After completing the installation, the web interface returned to the application list. There was no post-installation message with logon info, nor is an email sent or is ther eany information on the application page.

When trying to log in using either the admin email address or my own email address, it tels me “No account found using this email”.

Trying to reset the password, I get the same message and no email.

Now I wornder:

  • for those of you who have been uising it longer, did you also lose the database when upgrading?
  • did anyone recently install 2fauth, and use it successfully?

Share relevant logs or error messages

There is no log in the LAravel logs directery (/var/www/2fauth/storage/logs). The ngingx error log is empty; the access log shows a aline for each time I visited the login page and password reset page, but no useful information.

Solved following a hint by @marc in thread Yunohost 2FAuth Failed, by manually inserting a user in the database

INSERT INTO `users` (
  `id`
, `oauth_id`
, `oauth_provider`
, `name`
, `email`
, `email_verified_at`
, `password`
, `is_admin`
, `remember_token`
, `created_at`
, `updated_at`
, `last_seen_at`
, `preferences`) 
VALUES (
  NULL
, '1'
, '1'
, 'Boudewijn'
, 'wbk@mydomain.tld'
, NULL
, '$2y$10$r45mZlCgEbQ69DMGTpT1Q.xCMjyp5P53kgtkVL/ThOMV7v8KngvXm' --> use a bcrypt hash generator
, '1'
, NULL
, NULL
, '2025-07-12 20:54:44'
, '2025-07-12 20:54:44'
, NULL)

The installation log actually states the creation of the user table and marking of users as admin, as well as checking that the 2fauth user is a Yunohost-user, but even after multiple re-installations (also with more than one user as a test case), the problem persisted on my server. Running the above query solved the problem.

Please note that this insertion may be done without knowing any SQL language. Simply use the GUI PhpMyAdmin , and click on the “insert” menu.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.