For the first time in a week I was able to add the initial authentication of the Scrapcal app using the Devise plugin.
It doesn’t seem Devise is yet compatible with Rails 5.1, as it was just released. So I reset Rails to 5.0.
I was able to generate a set of rudimentary redirects using the instructions on the Devise Gem GitHub readme.
I also removed the ability for the public to sign up and recover their password by removing the ‘:registerable, :recoverable’ symbols from the devise line in the User model.
From this autogenerated model:
class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable end
To this Model:
class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :rememberable, :trackable, :validatable end
Cannot Logout with GET request
Once authenticated, it doesn’t show anything but the Home#index page
Right now I can’t seem to log out, as I believe the link shown above does a GET request and it needs to be DELETE. It is working on my local though, but shows an error when clicked on staging.
Here is the corresponding Rails log error:
Here is the ‘rake routes’ from staging (right) and local (left) to show the are identical.
Below is a quick changelog of the tasks completed tonight and the next steps.
Tasks Completed Tonight:
- Add Devise gem
- Implement initial models and routes
- Deploy to rudimentary staging
- Set up new scrapcal.com domain
- Buy Domain
- Set up Digital Ocean networking
- Set up Let’s Encrypt SSL for stage and prod
- Implement stage on stage.scrapcal.com
Tasks Up Next:
- Implement Gitlab CI for staging instance
- precompile assets
- Create simple readme
- Add to github (reset secrets?)
- Add secrets.yml for staging instance
- Fix /users/sign_out path problem
- Implement MySQL for staging instance
- Get better at logging?