Skip to content

Commit 9cff116

Browse files
committed
Implemented basic githubn oauth on development
1 parent 094edab commit 9cff116

28 files changed

+319
-124
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111
/log/*
1212
!/log/.keep
1313
/tmp
14+
15+
# Ignore application configuration
16+
/config/application.yml

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ gem "bootswatch-rails"
1414
gem "nokogiri"
1515
gem "whenever", require: false
1616
gem "hurley", require: false
17+
gem "omniauth-github"
18+
gem "figaro"
1719

1820
group :development, :test do
1921
gem "byebug"

Gemfile.lock

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,13 @@ GEM
7070
diff-lcs (1.2.5)
7171
erubis (2.7.0)
7272
execjs (2.6.0)
73+
faraday (0.9.2)
74+
multipart-post (>= 1.2, < 3)
75+
figaro (1.1.1)
76+
thor (~> 0.14)
7377
globalid (0.3.6)
7478
activesupport (>= 4.1.0)
79+
hashie (3.4.2)
7580
hurley (0.2)
7681
i18n (0.7.0)
7782
jbuilder (2.3.2)
@@ -82,6 +87,7 @@ GEM
8287
railties (>= 4.2.0)
8388
thor (>= 0.14, < 2.0)
8489
json (1.8.3)
90+
jwt (1.5.1)
8591
launchy (2.4.3)
8692
addressable (~> 2.3)
8793
loofah (2.0.3)
@@ -93,8 +99,25 @@ GEM
9399
mini_portile (0.6.2)
94100
minitest (5.8.1)
95101
multi_json (1.11.2)
102+
multi_xml (0.5.5)
103+
multipart-post (2.0.0)
96104
nokogiri (1.6.6.2)
97105
mini_portile (~> 0.6.0)
106+
oauth2 (1.0.0)
107+
faraday (>= 0.8, < 0.10)
108+
jwt (~> 1.0)
109+
multi_json (~> 1.3)
110+
multi_xml (~> 0.5)
111+
rack (~> 1.2)
112+
omniauth (1.2.2)
113+
hashie (>= 1.2, < 4)
114+
rack (~> 1.0)
115+
omniauth-github (1.1.2)
116+
omniauth (~> 1.0)
117+
omniauth-oauth2 (~> 1.1)
118+
omniauth-oauth2 (1.4.0)
119+
oauth2 (~> 1.0)
120+
omniauth (~> 1.2)
98121
pg (0.18.3)
99122
pry (0.10.2)
100123
coderay (~> 1.1.0)
@@ -194,11 +217,13 @@ DEPENDENCIES
194217
capybara
195218
coffee-rails (~> 4.1.0)
196219
database_cleaner
220+
figaro
197221
hurley
198222
jbuilder (~> 2.0)
199223
jquery-rails
200224
launchy
201225
nokogiri
226+
omniauth-github
202227
pg
203228
pry
204229
rails (= 4.2.4)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Place all the behaviors and hooks related to the matching controller here.
2+
# All this logic will automatically be available in application.js.
3+
# You can use CoffeeScript in this file: http://coffeescript.org/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Place all the behaviors and hooks related to the matching controller here.
2+
# All this logic will automatically be available in application.js.
3+
# You can use CoffeeScript in this file: http://coffeescript.org/
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
@import "bootstrap-sprockets";
22

3-
@import "bootswatch/cerulean/variables";
4-
53
@import "bootstrap";
64

7-
@import "bootswatch/cerulean/bootswatch";
5+
@import "custom";
6+
87

98

109

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
body {
2+
padding-top: 70px;
3+
}
4+
15
#leaderboard {
26
text-align: center;
3-
}
7+
}
8+
9+
.container-home {
10+
background-color: #1B3C59;
11+
min-height: 100vh;
12+
padding-top: 30vh;
13+
text-align: center;
14+
}
15+
16+
.home {
17+
color: white;
18+
font-weight: 100;
19+
font-size: 100;
20+
}
21+
22+
h1.home {
23+
font-size: 60px;
24+
color: #F8BB44;
25+
}
26+
27+
a.btn.btn-lg.btn-default.btn-home {
28+
background-color: transparent;
29+
border-width: 2px;
30+
color: #60BFBF;
31+
font-weight: 100;
32+
border-color: #60BFBF;
33+
margin-top: 20px;
34+
}
35+
36+
a.btn.btn-lg.btn-default.btn-home:hover {
37+
opacity: 0.4;
38+
}
39+
40+
img.img-circle.img-thumbnail.home-image {
41+
height: 200px;
42+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place all the styles related to the Dashboard controller here.
2+
// They will automatically be included in application.css.
3+
// You can use Sass (SCSS) here: http://sass-lang.com/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place all the styles related to the sessions controller here.
2+
// They will automatically be included in application.css.
3+
// You can use Sass (SCSS) here: http://sass-lang.com/

app/controllers/application_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@ class ApplicationController < ActionController::Base
22
# Prevent CSRF attacks by raising an exception.
33
# For APIs, you may want to use :null_session instead.
44
protect_from_forgery with: :exception
5+
6+
helper_method :current_user
7+
8+
def current_user
9+
@current_user ||= User.find(session[:user_id]) if session[:user_id]
10+
end
511
end

0 commit comments

Comments
 (0)