tramway-auth 1.2 → 1.2.1

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: c11a6584e129b2f9796a0595dd942024031b91f3db4216541d0e9f460f26926e
4
- data.tar.gz: 55284eb1417d7e13fe43b53339cbc537a8272b2623a5b60ec49f0b143ca2e398
3
+ metadata.gz: 22b1505238d191f5a627db8787628879d1a20520261a9c4d94508134114162d4
4
+ data.tar.gz: 5bf1ee01aefa1d8113086d99b6653eb1598cd61d995c2b07d6113377f122cd45
5
5
  SHA512:
6
- metadata.gz: 0431b5d2daa40b4d855c72c3d103f83480c12d73433e4018dc363bcf9664b5ddc195173f1c9b63146af0b31eea5dc2d283b3d299edd79f97770311ced2af60c9
7
- data.tar.gz: 1a19b60ac2d116557797a81cf70d31a5f5fcf699448d754e6bbea153588dd3e904a91656eec21c37460fe9d4e20f3b2266434bbc7e09ebc9540f955cc2afeba0
6
+ metadata.gz: 6d96c01edb04bff866fae0f9cc125720a3397150980f59056cf34e84335a357ced1f4add6932e783bc7267a100407620ca0d0b3706f924eb3e5738612eb76c19
7
+ data.tar.gz: ad4c49be046cee22bfb6c4694fa7ddc96f01ab47480261c8fb650f1c76b7c0109c963a9b240518a57b38a86d16a7491a259a014613a3f75823efda9263824866
@@ -4,9 +4,21 @@ class Tramway::Auth::Web::SignUpsController < Tramway::Auth::Web::ApplicationCon
4
4
  def create
5
5
  @form = "#{model_class}SignUpForm".constantize.new model_class.new
6
6
  if @form.submit params[:record]
7
- redirect_to Rails.application.routes.url_helpers.root_path flash: :success
7
+ additional_params = { flash: :success }
8
+ url = if params[:redirect].present?
9
+ [ params[:redirect], '?', additional_params.to_query].join
10
+ else
11
+ Rails.application.routes.url_helpers.root_path(flash: :success)
12
+ end
13
+ redirect_to url
8
14
  else
9
- redirect_to Rails.application.routes.url_helpers.root_path flash: :error, errors: @form.errors.messages, record: @form.attributes
15
+ additional_params = { flash: :error, errors: @form.errors.messages, record: @form.attributes }
16
+ url = if params[:redirect].present?
17
+ [ params[:redirect], '?', additional_params.to_query].join
18
+ else
19
+ Rails.application.routes.url_helpers.root_path(**additional_params)
20
+ end
21
+ redirect_to url
10
22
  end
11
23
  end
12
24
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Auth
5
- VERSION = '1.2'
5
+ VERSION = '1.2.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-24 00:00:00.000000000 Z
11
+ date: 2020-04-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for auth
14
14
  email: