diff --git a/app/controllers/auth_controller.rb b/app/controllers/auth_controller.rb index be7280c735fce6456973047e89b063bade3e6845..bd380c519c9f66f427a6a3896e50d7d81ab75dfd 100644 --- a/app/controllers/auth_controller.rb +++ b/app/controllers/auth_controller.rb @@ -16,9 +16,13 @@ class AuthController < ApplicationController def get_email ids = params["auth"]["ids"] emails = [] - ids.each do |i| - emails.push(User.find_by(id: i).email) - + if ids.kind_of?(Array) + ids.each do |i| + emails.push(User.find_by(id: i).email) + end + else + emails.push(User.find_by(id: ids).email) + end render json: { emails: emails }, status: 200 end