add brakeman and fix authentication issue