meroku 2.0.2 → 2.0.3

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
  SHA1:
3
- metadata.gz: 8769afa8548cc15558614fbdc529495a0d8742b6
4
- data.tar.gz: 9214a901836c05e98bdffdc9f4b1662976328409
3
+ metadata.gz: 74fd11997f53c773598e76575486b10572ce0acc
4
+ data.tar.gz: 901942c1d9a97b7095c26a6bda871661c6781ee5
5
5
  SHA512:
6
- metadata.gz: 6152d3160394868db6f46a978cbeee5eb4dee9d308ae45138a1f92eb8ed8a213e47ee84e0d3b070a5241a294f23033e2968fa119a02cb7d6b69bc10975a3a5e5
7
- data.tar.gz: 1410f02ff214e46191ee428bea44edb2c7b59aceab4d949ca787028f0bff015aa856f7694428a1670a8ba3303901740133612810825feefd82c8ce4d22b4f44d
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 json: @publickey.errors, status: :unprocessable_entity }
43
+ format.json { render jsonapi_errors: @publickey.errors }
38
44
  end
39
45
  end
40
46
  end
@@ -1,3 +1,3 @@
1
1
  module Meroku
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Weerasinghe