After 12 tries, finally fixed an authentication issue that just turned out to be a conflict between cloudfare dns and Rails 5+