diff options
| author | azul <azul@riseup.net> | 2018-01-31 04:44:15 -0800 | 
|---|---|---|
| committer | azul <azul@riseup.net> | 2018-01-31 04:44:15 -0800 | 
| commit | b58c2d841013ec9fc30c3c8e6dcc3ee73dccfbf4 (patch) | |
| tree | 5c8c2caf8a581b215c63c93444c5b72a5175c0f8 /app/controllers | |
| parent | a6e0378669118feeb0c42b6282b0b469fb11ad8f (diff) | |
| parent | a55cc3653de22d868ade5303918280a38e8e9fe8 (diff) | |
Merge branch 'feature/different-keytypes' into 'master'
couch: add identity view to get all keys
See merge request leap/webapp!61
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/api/keys_controller.rb | 7 | ||||
| -rw-r--r-- | app/controllers/api/users_controller.rb | 2 | 
2 files changed, 3 insertions, 6 deletions
| diff --git a/app/controllers/api/keys_controller.rb b/app/controllers/api/keys_controller.rb index 7eb76ee..32ccc19 100644 --- a/app/controllers/api/keys_controller.rb +++ b/app/controllers/api/keys_controller.rb @@ -5,14 +5,11 @@ class Api::KeysController < ApiController    # get /keys    def index -    keys = identity.keys.map do |k,v| -      [k, JSON.parse(v)] -    end -    render json: keys.to_h +    render json: identity.keys    end    def show -    render json: JSON.parse(identity.keys[params[:id]]) +    render json: identity.keys[params[:id]]    end    def create diff --git a/app/controllers/api/users_controller.rb b/app/controllers/api/users_controller.rb index 65b80c7..eda37e8 100644 --- a/app/controllers/api/users_controller.rb +++ b/app/controllers/api/users_controller.rb @@ -112,7 +112,7 @@ module Api        PgpKey.new(key).tap do |key|          if key.valid?            identity = Identity.for(@user) -          identity.set_key(:pgp, key) +          identity.set_key(:pgp, key.to_s)            identity.save          end        end | 
