optional-kubernetes-engine/app/controllers/sessions_controller.rb
# Handle Google OAuth 2.0 login callback.
#
# GET /auth/google_oauth2/callback
Handle Google OAuth 2.0 login callback.
Handle Google OAuth 2 . 0 login callback .
def create
    user_info = request.env["omniauth.auth"]
    user           = User.new
    user.id        = user_info["uid"]
    user.name      = user_info["info"]["name"]
    user.image_url = user_info["info"]["image"]
    session[:user] = Marshal.dump user
    redirect_to root_path
  end
def create user_info = request . env [ "omniauth.auth" ] user = User . new user . id = user_info [ "uid" ] user . name = user_info [ "info" ] [ "name" ] user . image_url = user_info [ "info" ] [ "image" ] session [ :user ] = Marshal . dump user redirect_to root_path end
Handle Google OAuth 2.0 login callback.
Handle Google OAuth 2 . 0 login callback .