add a token generator to the Dauth module and delegate to that instead of copy pasting the logic:

```ruby
module Dauth
  def self.generate_token
    ...
  end
end
...

Dauth.generate_token
```