symphonia 6.0.2 → 6.0.6

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
  SHA256:
3
- metadata.gz: 24d7848d1bca3b518accb57564e9c07c7b4650e5a02e5bd9c3bd33fbe60c5d72
4
- data.tar.gz: '078af52f5b5c5efe3fd4ac6bf2935250e25a83e98bfc842f8878413d21ec86a9'
3
+ metadata.gz: 74a34cf37cfed1df365d494cafd6f213807e896f0305d031a53c7919d56d41fa
4
+ data.tar.gz: 46383d23222548091c11b01dda86ed1ba3ae207316b320864f0586a548b7b1bd
5
5
  SHA512:
6
- metadata.gz: 85b194d20074685cd3f206e06be37240876fd805892180e60c38060d366efeb48b662c1296f5b277042778c997588d363224697e2c545f475dc970caae447962
7
- data.tar.gz: b23fad9e94c8d44c72feb31d42666f8bbdc610d9a598830d223a8784b32a1856464596af5ac651cc44a485bd7bf0ea341c5e310d4f9e5e86451209f4bb4fbdca
6
+ metadata.gz: 39c6ac12189497b6b15d3baf601ae45a0c5169fd1f690a5301f11047004d67be009f7821fea7f9b11967cc0fa144ba7946954c42589d8577fbe60ee62b335b17
7
+ data.tar.gz: f4d5cff4e7ec2e1449b5261c65905c4193b4396c849d12a6e6bb9ce2adf6bdbd884dacf911d7fd7c23de1aa160eeb4e44c468a889d61d3778e153b0a1b682a29
data/.rubocop.yml CHANGED
@@ -1,36 +1,5 @@
1
- require:
2
- - rubocop-rails
3
- - rubocop-rspec
1
+ inherit_gem:
2
+ symphonia_spec: .rubocop.yml
4
3
 
5
- AllCops:
6
- TargetRubyVersion: 2.5
7
- NewCops: enable
8
-
9
- Layout/EmptyLinesAroundClassBody:
10
- EnforcedStyle: empty_lines_special
11
- Layout/EmptyLinesAroundModuleBody:
12
- EnforcedStyle: empty_lines_except_namespace
13
- Layout/MultilineMethodCallIndentation:
14
- EnforcedStyle: indented_relative_to_receiver
15
-
16
- Metrics/AbcSize:
17
- Enabled: false
18
- Metrics/BlockLength:
19
- Enabled: false
20
- Metrics/MethodLength:
21
- Enabled: false
22
- Naming/VariableNumber:
23
- Enabled: false
24
-
25
- Style/Documentation:
26
- Enabled: false
27
- Style/FrozenStringLiteralComment:
28
- Enabled: false
29
- Style/MutableConstant:
30
- Enabled: false
31
- Style/NegatedIf:
32
- Enabled: false
33
- Style/StringLiterals:
34
- Enabled: false
35
- Style/TrailingCommaInHashLiteral:
36
- EnforcedStyleForMultiline: consistent_comma
4
+ Gemspec/DeprecatedAttributeAssignment:
5
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
+ ## [6.0.6] - 2025-01-19
9
+ ### Removed
10
+ - gemspec dependencies lock version
11
+
12
+ ## [6.0.5] - 2024-08-02
13
+ ### Fixed
14
+ - missing tests files
15
+
16
+ ## [6.0.4] - 2024-08-02
17
+ ### Changed
18
+ - update dependencies
19
+ - rescue from `ActionController::InvalidAuthenticityToken` in `ApplicationController`
20
+
21
+ ## [6.0.3] - 2024-07-22
22
+ ### Fixed
23
+ - disable Turbo on login form
24
+
25
+ ## [6.0.2] - 2023-10-18
26
+
8
27
  ## [6.0.1] - 2023-07-17
9
28
  ### Fixed
10
29
  - fix InvalidAuthenticityToken error for json request
@@ -94,7 +94,7 @@ module Symphonia
94
94
  @user.unarchive!
95
95
 
96
96
  respond_to do |format|
97
- format.html { redirect_to params[:back_url] || users_url }
97
+ format.html { redirect_to params[:back_url] || users_url, allow_other_host: false }
98
98
  format.xml { head :no_content }
99
99
  end
100
100
  end
@@ -1,17 +1,17 @@
1
1
  <%= f.error_messages %>
2
2
  <%= hidden_field_tag(:back_url, back_url || session[:back_url]) %>
3
- <%= f.text_field :login, required: true, autofocus: true, autocomplete: "username" %>
4
3
 
4
+ <%= f.text_field :login, required: true, autofocus: true, autocomplete: "username" %>
5
5
  <%= f.password_field :password, required: true, autocomplete: "current-password" %>
6
6
 
7
7
  <%= f.form_group :remember_me do %>
8
8
  <%= f.check_box :remember_me %>
9
9
  <% end %>
10
10
 
11
- <%= f.submit t(:button_login), class: 'btn btn-primary btn-block' %>
12
- <% if f.object.is_a?(Symphonia::UserSession) %>
13
- <%= link_to(t(:label_reset_password), lost_password_account_path, remote: true, class: 'btn btn-link btn-sm ') %>
14
- <% if Symphonia.config[:allow_registrations] %>
15
- <%= link_to(t(:button_register), register_path, class: 'btn btn-link btn-sm ') %>
16
- <% end %>
11
+ <%= f.submit t(:button_login), class: "btn btn-primary btn-block" %>
12
+ <% if f.object.is_a?(Symphonia::UserSession) %>
13
+ <%= link_to(t(:label_reset_password), lost_password_account_path, remote: true, class: "btn btn-link btn-sm") %>
14
+ <% if Symphonia.config[:allow_registrations] %>
15
+ <%= link_to(t(:button_register), register_path, class: "btn btn-link btn-sm") %>
17
16
  <% end %>
17
+ <% end %>
@@ -2,8 +2,8 @@
2
2
  <div class="col-md-6 col-xs-12 mx-auto">
3
3
  <div class="card w-75 mx-auto">
4
4
  <div class="card-body">
5
- <%= symphonia_form_for(@model_session, as: :login_session, html: { id: 'login-form' }) do |f| %>
6
- <%= render('form', f: f) %>
5
+ <%= symphonia_form_for(@model_session, as: :login_session, html: { id: "login-form", data: { turbo: false } }) do |f| %>
6
+ <%= render("form", f: f) %>
7
7
  <% end %>
8
8
  </div>
9
9
  </div>
@@ -7,7 +7,6 @@ module Symphonia
7
7
  end
8
8
 
9
9
  included do
10
-
11
10
  before_action :current_user, :menu_item
12
11
  before_action :set_default_locale
13
12
 
@@ -18,13 +17,16 @@ module Symphonia
18
17
 
19
18
  rescue_from ::ActiveRecord::RecordNotFound, with: :render_404
20
19
  rescue_from Unauthorized, CanCan::AccessDenied, with: :render_403
20
+ rescue_from ActionController::InvalidAuthenticityToken do |_exception|
21
+ head :service_unavailable
22
+ end
21
23
 
22
24
  helper_method :current_user, :back_url
23
25
  end
24
26
 
25
27
  def back_url
26
28
  url = params[:back_url].presence
27
- if url.nil? && (referer = request.env['HTTP_REFERER'].presence)
29
+ if url.nil? && (referer = request.env["HTTP_REFERER"].presence)
28
30
  url = CGI.unescape(referer.to_s)
29
31
  end
30
32
  url
@@ -48,7 +50,7 @@ module Symphonia
48
50
  def set_locale
49
51
  params_locale = params.fetch(:locale, nil).presence
50
52
  params_locale ||= session[:locale].presence
51
- params_locale ||= request.env['HTTP_ACCEPT_LANGUAGE'].to_s.split(',').collect { |l| l.scan(/^[a-z]{2}/) }.flatten
53
+ params_locale ||= request.env["HTTP_ACCEPT_LANGUAGE"].to_s.split(",").collect { |l| l.scan(/^[a-z]{2}/) }.flatten
52
54
  client_lang = Array(params_locale).compact
53
55
  client_lang.unshift current_user.language if current_user.language
54
56
  @client_lang = client_lang.detect { |l| I18n.available_locales.include?(l.to_sym) }
@@ -75,7 +77,7 @@ module Symphonia
75
77
  redirect_to symphonia.login_path, flash: { error: t(:text_login_require) }
76
78
  end
77
79
  format.json do
78
- render json: { errors: 'You must be logged in to access this endpoint' }, status: :unauthorized
80
+ render json: { errors: "You must be logged in to access this endpoint" }, status: :unauthorized
79
81
  end
80
82
  format.any { head :unauthorized }
81
83
  end
@@ -89,29 +91,28 @@ module Symphonia
89
91
 
90
92
  def admin_require
91
93
  return unless login_require
94
+ return if current_user.admin?
92
95
 
93
- unless current_user.admin?
94
- render_403
95
- false
96
- end
96
+ render_403
97
+ false
97
98
  end
98
99
 
99
100
  alias require_admin admin_require
100
101
 
101
102
  def render_403
102
103
  respond_to do |format|
103
- format.html { render template: 'common/403', message: :notice_not_authorized, status: :forbidden }
104
+ format.html { render template: "common/403", message: :notice_not_authorized, status: :forbidden }
104
105
  format.js do
105
106
  render plain: "alert('#{t :text_access_deny}')", message: :notice_not_authorized, status: :forbidden
106
107
  end
107
- format.any { head 403, message: :notice_not_authorized }
108
+ format.any { head :forbidden, message: :notice_not_authorized }
108
109
  end
109
110
  end
110
111
 
111
112
  def render_404
112
113
  respond_to do |format|
113
- format.html { render template: 'common/404', message: :notice_page_not_found, status: :not_found }
114
- format.any { head 404, message: :not_found }
114
+ format.html { render template: "common/404", message: :notice_page_not_found, status: :not_found }
115
+ format.any { head :not_found, message: :not_found }
115
116
  end
116
117
  end
117
118
 
@@ -126,7 +127,7 @@ module Symphonia
126
127
  end
127
128
 
128
129
  def menu_item(item = nil)
129
- @menu_item = (item || controller_name)
130
+ @menu_item = item || controller_name
130
131
  end
131
132
 
132
133
  def current_user_session
@@ -153,9 +154,9 @@ module Symphonia
153
154
  return true if current_user&.logged_in? && request.format&.json?
154
155
 
155
156
  current_user_session&.destroy
156
- raise ActionController::InvalidAuthenticityToken
157
+ # raise ActionController::InvalidAuthenticityToken
157
158
 
158
- # redirect_to main_app.root_url
159
+ super
159
160
  end
160
161
 
161
162
  def store_location
@@ -1,5 +1,5 @@
1
1
  module Symphonia
2
2
 
3
- VERSION = '6.0.2'
3
+ VERSION = "6.0.6"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,99 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symphonia
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.2
4
+ version: 6.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Pokorny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-18 00:00:00.000000000 Z
11
+ date: 2025-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: api-pagination
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: authlogic
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '6.4'
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '6.4'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootstrap_form
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '4.4'
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '4.4'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: cancancan
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '3.4'
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '3.4'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: net-smtp
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.3.1
75
+ version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.3.1
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rails-i18n
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '7.0'
89
+ version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '7.0'
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -112,58 +112,58 @@ dependencies:
112
112
  name: rdiscount
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '2.2'
117
+ version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '2.2'
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: scrypt
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: '3.0'
131
+ version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: '3.0'
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: sidekiq
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: '7.1'
145
+ version: '0'
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: '7.1'
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: sidekiq-cron
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: '1.10'
159
+ version: '0'
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: '1.10'
166
+ version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: sortable-table
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -182,16 +182,16 @@ dependencies:
182
182
  name: will_paginate
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - "~>"
185
+ - - ">="
186
186
  - !ruby/object:Gem::Version
187
- version: '4.0'
187
+ version: '0'
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - "~>"
192
+ - - ">="
193
193
  - !ruby/object:Gem::Version
194
- version: '4.0'
194
+ version: '0'
195
195
  description: Basis of my applications
196
196
  email:
197
197
  - admin@luk4s.cz
@@ -396,7 +396,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
396
396
  - !ruby/object:Gem::Version
397
397
  version: '0'
398
398
  requirements: []
399
- rubygems_version: 3.4.16
399
+ rubygems_version: 3.5.11
400
400
  signing_key:
401
401
  specification_version: 4
402
402
  summary: My administration