meroku 2.0.2 → 2.0.3
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 +4 -4
- data/frontend/app/controllers/publickeys_controller.rb +8 -2
- data/lib/meroku/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74fd11997f53c773598e76575486b10572ce0acc
|
4
|
+
data.tar.gz: 901942c1d9a97b7095c26a6bda871661c6781ee5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: def75bd1beabc9fd05db76c4dd75bce0bcb6422b844ce38887287b4ce25a4e79958ba5f59d8df04aba7c5fca59d8b341e2ab6eee597a83fb2ffa1f710d08797d
|
7
|
+
data.tar.gz: 72d8f5f166cb5c546cf5c9da204a4578a382709d9f4da0d08692fb066c1bf1717f8db3ad660dd70f81d7f776ea0625b8673139b9b62a77f3d4dc4826164b5e87
|
@@ -27,14 +27,20 @@ class PublickeysController < ApplicationController
|
|
27
27
|
def create
|
28
28
|
@publickey = Publickey.new(publickey_params)
|
29
29
|
@publickey.user = User.find_by_token(params[:token])
|
30
|
+
if !@publickey.user
|
31
|
+
(render :jsonapi_errors => [{
|
32
|
+
title: 'Invalid Authorization Token',
|
33
|
+
detail: 'Invalid token. Try logging in again.'
|
34
|
+
}]) and return
|
30
35
|
|
31
36
|
respond_to do |format|
|
32
37
|
if @publickey.save
|
33
38
|
format.html { redirect_to @publickey, notice: 'Publickey was successfully created.' }
|
34
|
-
format.json { render :show, status: :created, location: @publickey }
|
39
|
+
#format.json { render :show, status: :created, location: @publickey }
|
40
|
+
format.json { render jsonapi: @publickey }
|
35
41
|
else
|
36
42
|
format.html { render :new }
|
37
|
-
format.json { render
|
43
|
+
format.json { render jsonapi_errors: @publickey.errors }
|
38
44
|
end
|
39
45
|
end
|
40
46
|
end
|
data/lib/meroku/version.rb
CHANGED