app/controllers/sessions_controller.rb
def omniauth
        teacher = Teacher.from_omniauth(request.env['omniauth.auth'])
    # byebug
        if teacher.valid?
            session[:teacher_id] = teacher.id
            redirect_to home_path
        else
            redirect_to 'login'
        end
    end
# omniauth login, see #from_omniauth in Teacher model
omniauth login, see #from_omniauth in Teacher model
omniauth login see #from_omniauth in Teacher model
def omniauth
        teacher = Teacher.from_omniauth(request.env['omniauth.auth'])
        if teacher.valid?
            session[:teacher_id] = teacher.id
            redirect_to home_path
        else
            redirect_to 'login'
        end
    end
def omniauth teacher = Teacher . from_omniauth ( request . env [ 'omniauth.auth' ] ) if teacher . valid? session [ :teacher_id ] = teacher . id redirect_to home_path else redirect_to 'login' end end
omniauth login, see #from_omniauth in Teacher model
omniauth login see #from_omniauth in Teacher model
# byebug