authpls 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 33ae06b9b36d9223ee5e4d2a8da0a717fe48ecc9a7f06c853fd503280b0ef87e
|
|
4
|
+
data.tar.gz: aa2f5c3d6f4b0a9a00b00c325dea961a279398ab75d1d19b4e7e2b7a5348f5d3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1596ecfcf3aedaf950272f85dad56a9b350a511f14fbc4ec3cb704294bca977c62bfe85f115571903ac692def296e3806bcb81284e82e6ca4b31e7967ba8b503
|
|
7
|
+
data.tar.gz: 7d467f3de15c39b39485928214fecfc423684278bf01d3a0c44f5839418a8858785cb7283582a1bfe161e513e6b3da9d80cd4511c19e4414ab651d6fc866d9bb
|
data/lib/authpls/version.rb
CHANGED
|
@@ -72,7 +72,7 @@ module Authpls
|
|
|
72
72
|
resource :registration, only: %i[create]
|
|
73
73
|
resource :profile, only: %i[show update destroy]
|
|
74
74
|
resources :users, only: %i[index show update destroy]
|
|
75
|
-
resources :passwords, only: %i[create update]
|
|
75
|
+
resources :passwords, only: %i[create update], param: :token
|
|
76
76
|
resources :signup_tokens, only: %i[create]
|
|
77
77
|
end
|
|
78
78
|
RUBY
|
|
@@ -9,15 +9,15 @@ module Auth
|
|
|
9
9
|
PasswordsMailer.reset(user).deliver_later
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
render json: { message: 'Password reset instructions sent' }, status:
|
|
12
|
+
render json: { message: 'Password reset instructions sent' }, status: :accepted
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def update
|
|
16
16
|
if @user.update(params.permit(:password, :password_confirmation))
|
|
17
17
|
@user.sessions.destroy_all
|
|
18
|
-
render json: { message: 'Password has been reset.' }
|
|
18
|
+
render json: { message: 'Password has been reset.' }
|
|
19
19
|
else
|
|
20
|
-
render json: { errors: @user.errors.full_messages }, status:
|
|
20
|
+
render json: { errors: @user.errors.full_messages }, status: :unprocessable_content
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
@@ -28,7 +28,7 @@ module Auth
|
|
|
28
28
|
rescue ActiveSupport::MessageVerifier::InvalidSignature
|
|
29
29
|
render json: {
|
|
30
30
|
errors: ['Password reset link is invalid or has expired.']
|
|
31
|
-
}, status:
|
|
31
|
+
}, status: :unauthorized
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|