rewrite authenticator.rb