skip sign up for CMU sign in

Auto-create user when using CMU sign for the first time.

The fix in app/model/user.rb is to change self.instructor_of? to instructor_of?. Other diffs are just cleanup.
nope :(

-------- Original message --------
From: Ilter <notifications@github.com> 
Date: 2014/12/23  17:10  (GMT+08:00) 
To: autolab/Autolab <Autolab@noreply.github.com> 
Cc: An Wu <anwu@andrew.cmu.edu> 
Subject: Re: [Autolab] skip sign up for CMU sign in (#49) 
 
In app/controllers/users/omniauth_callbacks_controller.rb:

> @@ -67,9 +67,26 @@ def shibboleth
>          sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated
>          set_flash_message(:notice, :success, :kind => "Shibboleth") if is_navigational_format?
>        else
> -        # automatic cleanup of devise.* after sign in
> -        session["devise.shibboleth_data"] = request.env["omniauth.auth"]
> -        redirect_to new_user_registration_url
> +        # Skip sign up for CMU Shibboleth user
> +        @user = User.new
> +        
> +        data = request.env["omniauth.auth"]
> +        @user.email = data["uid"]  # email is uid in our case
> +        @user.authentications.new(provider: "CMU-Shibboleth",
> +                                 uid: data["uid"])
> +                                 
> +        # Auto-generate placeholder name and password
> +        @user.first_name = "(blank)"
> +        @user.last_name = "(blank)"
Any chance that we can get name and last name from shib?

—
Reply to this email directly or view it on GitHub.