authentication-zero 2.12.0 → 2.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/authentication-zero-api.md +1 -16
- data/lib/authentication_zero/version.rb +1 -1
- data/lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt +4 -1
- data/lib/generators/authentication/templates/controllers/api/sessions_controller.rb.tt +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a4a255a118044ab6bdcf5af654088a4636a027db4d5652401087275cc14609e
|
4
|
+
data.tar.gz: 935d89fb3cd66416f7bcc9932dfa8d097fd2d103e6577ed59f728bb6568d99fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1479fde381e5a5f5f1cbd58aa8847dcf83d9ba32a6d474b239a44df5e25fea18bd758bb022112813b00890c573e55ad50ffc8f586c84531fc58b98a143a5c3c2
|
7
|
+
data.tar.gz: e6452d39abad6ace236c4ab6e418b6f5fe313fc4413adf558a49893d70ef63fbb5416e601fe01d26477b379654bc135e30f2f978fce6aa7f8cb2979bf3d7e388
|
data/Gemfile.lock
CHANGED
data/authentication-zero-api.md
CHANGED
@@ -21,7 +21,6 @@ curl -H "Authorization: Bearer $ACCESS_TOKEN" \
|
|
21
21
|
- [Get your sessions](#get-your-sessions)
|
22
22
|
- [Get a session](#get-a-session)
|
23
23
|
- [Destroy a session](#destroy-a-session)
|
24
|
-
- [Execute sudo](#execute-sudo)
|
25
24
|
- [Update your password](#update-your-password)
|
26
25
|
- [Update your email](#update-your-email)
|
27
26
|
- [Send verification email](#send-verification-email)
|
@@ -115,21 +114,6 @@ This endpoint will return `201 Created` with the current JSON representation of
|
|
115
114
|
|
116
115
|
Returns `204 No Content` if successful.
|
117
116
|
|
118
|
-
|
119
|
-
### Execute sudo
|
120
|
-
|
121
|
-
* `POST /sessions/sudo` will grant temporary access to sensitive information.
|
122
|
-
|
123
|
-
###### Example JSON Request
|
124
|
-
|
125
|
-
``` json
|
126
|
-
{
|
127
|
-
"password": "Secret1*2*3*4*5*6",
|
128
|
-
}
|
129
|
-
```
|
130
|
-
|
131
|
-
Returns `204 No Content` if successful.
|
132
|
-
|
133
117
|
## Password
|
134
118
|
|
135
119
|
### Update your password
|
@@ -158,6 +142,7 @@ This endpoint will return 200 OK with the current JSON representation of the use
|
|
158
142
|
|
159
143
|
``` json
|
160
144
|
{
|
145
|
+
"current_password": "Secret1*2*3*4*5*6",
|
161
146
|
"email": "new_email@hey.com"
|
162
147
|
}
|
163
148
|
```
|
@@ -5,7 +5,10 @@ class RegistrationsController < ApplicationController
|
|
5
5
|
@user = User.new(user_params)
|
6
6
|
|
7
7
|
if @user.save
|
8
|
-
|
8
|
+
session = @user.sessions.create!
|
9
|
+
response.set_header "X-Session-Token", session.signed_id
|
10
|
+
|
11
|
+
render json: session, status: :created
|
9
12
|
else
|
10
13
|
render json: @user.errors, status: :unprocessable_entity
|
11
14
|
end
|
@@ -16,7 +16,7 @@ class SessionsController < ApplicationController
|
|
16
16
|
|
17
17
|
if user && user.authenticate(params[:password])
|
18
18
|
@session = user.sessions.create!
|
19
|
-
response.set_header
|
19
|
+
response.set_header "X-Session-Token", @session.signed_id
|
20
20
|
|
21
21
|
render json: @session, status: :created
|
22
22
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authentication-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.12.
|
4
|
+
version: 2.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nixon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|