Skip to content

Commit 44d5b57

Browse files
authored
Merge pull request #78 from tvdeyen/4.2-stable
4.2 stable
2 parents 43e4264 + bb2a50c commit 44d5b57

28 files changed

Lines changed: 272 additions & 90 deletions

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ dist: trusty
33
sudo: false
44
cache: bundler
55
rvm:
6-
- 2.2.7
7-
- 2.3.5
8-
- 2.4.2
6+
- 2.4.5
7+
- 2.5.5
8+
- 2.6.2
99
branches:
1010
only:
1111
- master

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 4.2.0 (unreleased)
2+
3+
- Do not store screen size at login [#78](https://github.com/AlchemyCMS/alchemy-devise/pull/78) ([tvdeyen](https://github.com/tvdeyen))
4+
- Security: Use at least Devise 4.6 [#78](https://github.com/AlchemyCMS/alchemy-devise/pull/78) ([tvdeyen](https://github.com/tvdeyen))
5+
- Fix dummy app rails version [#76](https://github.com/AlchemyCMS/alchemy-devise/pull/76) ([tvdeyen](https://github.com/tvdeyen))
6+
- Fix translation key on user admin page [#75](https://github.com/AlchemyCMS/alchemy-devise/pull/75) ([mamhoff](https://github.com/mamhoff))
7+
8+
19
## 4.1.0 (2018-09-22)
210

311
- Only allow Alchemy > 4.1 [#72](https://github.com/AlchemyCMS/alchemy-devise/pull/72) ([tvdeyen](https://github.com/tvdeyen))

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ unless ENV['CI']
1010
gem 'pry'
1111
gem 'spring-commands-rspec'
1212
gem 'launchy'
13+
gem 'github_fast_changelog', require: false
1314
end
1415

1516
group :test do

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## Devise based authentication for Alchemy 4.1
1+
## Devise based authentication for AlchemyCMS 4.2
22

33
[![Build Status](https://secure.travis-ci.org/AlchemyCMS/alchemy-devise.svg?branch=master)](http://travis-ci.org/AlchemyCMS/alchemy-devise)
44

55
[![Gem Version](https://badge.fury.io/rb/alchemy-devise.svg)](http://badge.fury.io/rb/alchemy-devise) [![Test Coverage](https://codeclimate.com/github/AlchemyCMS/alchemy-devise/badges/coverage.svg)](https://codeclimate.com/github/AlchemyCMS/alchemy-devise/coverage) [![Code Climate](https://codeclimate.com/github/AlchemyCMS/alchemy-devise/badges/gpa.svg)](https://codeclimate.com/github/AlchemyCMS/alchemy-devise) [![security](https://hakiri.io/github/AlchemyCMS/alchemy-devise/master.svg)](https://hakiri.io/github/AlchemyCMS/alchemy-devise/master)
66

7-
**CAUTION: This master branch is a development branch that can contain bugs. For productive environments you should use the [current Ruby gem version](https://rubygems.org/gems/alchemy-devise/versions/4.1.0), or the [latest stable branch (4.1-stable)](https://github.com/AlchemyCMS/alchemy-devise/tree/4.1-stable).**
7+
**CAUTION: This master branch is a development branch that can contain bugs. For productive environments you should use the [current Ruby gem version](https://rubygems.org/gems/alchemy-devise/versions/4.1.0), or the [latest stable branch (4.2-stable)](https://github.com/AlchemyCMS/alchemy-devise/tree/4.2-stable).**
88

99
AlchemyCMS has no authentication in its core. So it is possibly to bring your own authentication and use it to authorize users in AlchemyCMS. If you don't have your own authentication, you can use this gem.
1010

@@ -17,7 +17,7 @@ Just put the gem into your projects `Gemfile`.
1717
gem 'alchemy-devise', github: 'AlchemyCMS/alchemy-devise', branch: 'master'
1818
```
1919

20-
**NOTE:** You normally want to use a stable branch, like `4.1-stable`.
20+
**NOTE:** You normally want to use a stable branch, like `4.2-stable`.
2121

2222
and run `bundle install`.
2323

Rakefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,24 @@ cd -
3939
BASH
4040
end
4141
end
42+
43+
namespace :changelog do
44+
desc "Update changelog"
45+
task :update do
46+
original_file = './CHANGELOG.md'
47+
new_file = original_file + '.new'
48+
backup = original_file + '.old'
49+
changes = `git rev-list #{ENV['PREVIOUS_VERSION']}...master | bundle exec github_fast_changelog AlchemyCMS/alchemy-devise`
50+
File.open(new_file, 'w') do |fo|
51+
fo.puts changes
52+
File.foreach(original_file) do |li|
53+
fo.puts li
54+
end
55+
fo.puts ""
56+
end
57+
File.rename(original_file, backup)
58+
File.rename(new_file, original_file)
59+
File.delete(backup)
60+
end
61+
end
4262
end

alchemy-devise.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
1717
s.test_files = Dir["spec/**/*"]
1818

1919
s.add_dependency "alchemy_cms", [">= 4.1.0.beta", "< 4.99"]
20-
s.add_dependency "devise", [">= 4.0", "< 4.99"]
20+
s.add_dependency "devise", [">= 4.6.0", "< 4.99"]
2121

2222
s.add_development_dependency "capybara"
2323
s.add_development_dependency "factory_bot_rails"

app/controllers/alchemy/admin/users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def index
1717
@query.sorts = 'login asc' if @query.sorts.empty?
1818
@users = @query.result
1919
.page(params[:page] || 1)
20-
.per(per_page_value_for_screen_size)
20+
.per(items_per_page)
2121
end
2222

2323
def new

app/controllers/alchemy/user_sessions_controller.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def create
2020
authenticate_user!
2121

2222
if user_signed_in?
23-
store_screen_size
2423
if session[:redirect_path].blank?
2524
redirect_path = admin_dashboard_path
2625
else
@@ -49,10 +48,6 @@ def check_user_count
4948
end
5049
end
5150

52-
def store_screen_size
53-
session[:screen_size] = params[:user_screensize]
54-
end
55-
5651
# Overwriting the default of Devise
5752
def after_sign_out_path_for(resource_or_scope)
5853
if request.referer.blank? || request.referer.to_s =~ /admin/

app/views/alchemy/user_sessions/new.html.erb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
</small>
1010
</div>
1111
<div class="submit">
12-
<%= hidden_field_tag 'user_screensize' %>
1312
<button class="secondary"><%= Alchemy.t(:login) %></button>
1413
</div>
1514
<% end %>
@@ -19,9 +18,6 @@
1918
<script type="text/javascript" charset="utf-8">
2019
jQuery(function($) {
2120
$('#user_login').focus();
22-
$('#user_screensize').val(function() {
23-
return screen.width+'x'+screen.height;
24-
});
2521
});
2622
</script>
2723
<%- end -%>
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1+
# frozen_string_literal: true
2+
13
FactoryBot.define do
2-
factory :alchemy_user, class: 'Alchemy::User' do
4+
factory :alchemy_user, class: Alchemy::User do
35
sequence(:login) { |n| "john_#{n}.doe" }
46
sequence(:email) { |n| "john_#{n}@doe.com" }
5-
firstname 'John'
6-
lastname 'Doe'
7-
password 's3cr3t'
8-
password_confirmation 's3cr3t'
7+
firstname { 'John' }
8+
lastname { 'Doe' }
9+
password { 's3cr3t' }
10+
password_confirmation { 's3cr3t' }
911

1012
factory :alchemy_admin_user do
11-
alchemy_roles 'admin'
13+
alchemy_roles { 'admin' }
1214
end
1315

1416
factory :alchemy_member_user do
15-
alchemy_roles 'member'
17+
alchemy_roles { 'member' }
1618
end
1719

1820
factory :alchemy_author_user do
19-
alchemy_roles 'author'
21+
alchemy_roles { 'author' }
2022
end
2123

2224
factory :alchemy_editor_user do
23-
alchemy_roles 'editor'
25+
alchemy_roles { 'editor' }
2426
end
2527
end
2628
end

0 commit comments

Comments
 (0)