Skip to content

Commit e14855e

Browse files
committed
wip
1 parent b53b459 commit e14855e

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

app/controllers/sessions_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ def new
99
def create
1010
auth = request.env['omniauth.auth']
1111

12+
binding.pry
13+
1214
unless User.team_member?(auth[:uid])
1315
return redirect_to login_url, alert: 'Only team member can login'
1416
end

config/initializers/omniauth.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
provider :slack,
33
ENV['SLACK_CLIENT_ID'],
44
ENV['SLACK_CLIENT_SECRET'],
5-
scope: 'identify'
5+
scope: 'identity.basic,identity.team,identity.avatar'
66

77
on_failure { |env| OmniAuth::FailureEndpoint.new(env).redirect_to_failure }
88
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddImageToUsers < ActiveRecord::Migration[5.0]
2+
def change
3+
add_column :users, :image, :string
4+
end
5+
end

db/schema.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# It's strongly recommended that you check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(version: 20160516050348) do
14+
ActiveRecord::Schema.define(version: 20160614083937) do
1515

1616
# These are extensions that must be enabled in order to support this database
1717
enable_extension "plpgsql"
@@ -31,6 +31,7 @@
3131
t.datetime "updated_at"
3232
t.string "provider"
3333
t.string "uid"
34+
t.string "image"
3435
end
3536

3637
add_foreign_key "posts", "users"

0 commit comments

Comments
 (0)