Files
ubicloud/spec/routes/web/spec_helper.rb
Jeremy Evans 9510ea2cdd Add authentication to admin site
This adds a Rodauth configuration to the admin site. The Rodauth
configuration requires password+WebAuthn authentication. It
supports changing passwords, but not resetting passwords, and
it does not support creating accounts.  To create an account
on the admin site, you need to run the following code in pry:

```ruby
CloverAdmin.create_admin_account("your-user-name")
```

This will create a random password, add the account to the
datbaase, and return the password. You can then login to the
admin site using the username and password, after which you
will be prompted to setup WebAuthn authentication. After
setting up WebAuthn authentication, you can change your
password (alternatively, pass a password of your choice
as a second argument to CloverAdmin.create_admin_account).

Took me a while to figure out that you need to use
Capybara.default_host= to set the host name, otherwise,
you get broken behavior when using visit. Since that only
should be set for requests to the admin site, this sets
the default_host back to the default in the after hook.
2025-07-18 16:49:27 -07:00

2.6 KiB