In this app, GitHub authentication is the sole authentication option. To avoid being automatically logged in in the localhost environment, I can log out of GitHub in my browser or open up the localhost site in private to get the option to log in. However, clicking on the "Log in" option then takes me to https://github.com/login, which means that I can only log in as myself and not one of the seeded users.
Given this, what's the procedure to log in as one of the seeded users?
/home/winner/.rbenv/gems/2.6.0/gems/devise-4.5.0/lib/devise/controllers/sign_in_out.rb:112:in `expire_data_after_sign_in!': undefined local variable or method `session' for main:Object (NameError)
require File.expand_path('../config/environment', __FILE__)
require 'devise'
include Devise::Controllers::SignInOut
users = User.all;
num_users = User.count;
n_first = 0;
n_last = num_users - 1;
puts '---------------------------'
puts 'Logging in as a seeded user'
puts ''
puts "Pick a user number from #{n_first} to #{n_last}:"
n_input = gets.chomp().to_i;
@user = users[n_input];
puts @user
bypass_sign_in @user, scope: :user
--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/d85MICj-BJQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/21df3d80-5f5b-4f60-a28a-0bd6d4e5a13d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b6c29750-0729-4b96-a897-d0a086efb132%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.