minimum-omniauth-scaffold 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 342dc584a9e265365ef9429611f7f3c96929a65e
4
- data.tar.gz: a8c3de60e803ecb5db700b1eb123df12bb2d6437
3
+ metadata.gz: 33892c60d2859d617507140936a030ec64dabc25
4
+ data.tar.gz: 1368589131c08029d0e2374109e2fa971365aa76
5
5
  SHA512:
6
- metadata.gz: c96ab22403702d67e0735771ed2994f824f1b3f12c424cdb86b646588e2bbf8cfeb7358871fac1fcb021f023b16d0d45ee38e48e649ad427ea2a17ef622ef364
7
- data.tar.gz: 03c664e9aedca10ee739fb290b0e80a0fe4b785678fef5a18624f1b4a2b76e56ac426620c1e2fd83a54c80e0198f6c005984350e4d6b34f035f635e3e681b1b1
6
+ metadata.gz: 3158e5392c0bcec58f4f7d2e45cda5083860ea88780c5afe2362e155bef373311006d5a3f0ea47c35600b456148182115a4430350f5008f800758d376602783f
7
+ data.tar.gz: e20e4edf4c4d02c354f63e90b9508e29ba3bb53dfb99a5f81db0a1ac4a2ec2262c91ae046681207d43f393cff3446ba679840468ec6335c5086e090702d7fedd
@@ -1,19 +1,16 @@
1
- before_filter :authorize # ログイン認証
1
+ before_filter :authenticate # ログイン認証
2
2
  before_filter :reset_session_expires # セッション有効期限延長
3
3
 
4
4
  private
5
5
 
6
6
  # ログイン認証
7
- def authorize
8
- # セッション/トップコントローラ以外で
9
- if params[:controller] != "sessions" and params[:controller] != "top"
10
- unless user_signed_in?
11
- # リクエストURL保管
12
- session[:request_url] = request.url
7
+ def authenticate
8
+ unless signed_in?
9
+ # リクエストURL保管
10
+ session[:request_url] = request.url
13
11
 
14
- # ルートヘリダイレクト
15
- redirect_to :root and return
16
- end
12
+ # ルートヘリダイレクト
13
+ redirect_to :root and return
17
14
  end
18
15
  end
19
16
 
@@ -29,7 +26,7 @@
29
26
  helper_method :current_user
30
27
 
31
28
  # ユーザ登録チェック
32
- def user_signed_in?
29
+ def signed_in?
33
30
  User.where( id: session[:user_id] ).exists?
34
31
  end
35
- helper_method :user_signed_in?
32
+ helper_method :signed_in?
@@ -1,4 +1,6 @@
1
1
  class SessionsController < ApplicationController
2
+ skip_before_filter :authenticate
3
+
2
4
  # ログイン
3
5
  def callback
4
6
  auth = request.env["omniauth.auth"]
@@ -1,4 +1,6 @@
1
1
  class TopController < ApplicationController
2
+ skip_before_filter :authenticate
3
+
2
4
  # トップ
3
5
  def index
4
6
  end
@@ -11,3 +11,6 @@ programmer_twitter_id: "PROGRAMMER_TWITTER_ID"
11
11
 
12
12
  # デザイナーTwitterID
13
13
  designer_twitter_id: "DESIGNER_TWITTER_ID"
14
+
15
+ # 曜日
16
+ weekday: ["日", "月", "火", "水", "木", "金", "土"]
@@ -1,6 +1,6 @@
1
1
  <%= link_to Settings.app_name, :root %>
2
2
 
3
- <% if user_signed_in? %>
3
+ <% if signed_in? %>
4
4
  <%# ログイン済み %>
5
5
  <%= render partial: '/layouts/user_icon', locals: { user: current_user, size: "18x18", klass: "margin_minus2" } %>
6
6
  <%= link_to( "Top", root_path ) %>
@@ -1,7 +1,7 @@
1
1
  module Minimum
2
2
  module Omniauth
3
3
  module Scaffold
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimum-omniauth-scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - shu0115