Updated code to match more recent dependencies.

This commit is contained in:
Luka Vandervelden 2019-12-12 00:45:12 +01:00
parent 2805356791
commit 4b94f72962
2 changed files with 5 additions and 5 deletions

View File

@ -24,8 +24,8 @@ dependencies:
jwt:
github: crystal-community/jwt
branch: master
fs:
git: https://git.karchnu.fr/WeirdOS/fs.cr
dodb:
git: https://git.karchnu.fr/WeirdOS/dodb.cr
branch: master
license: EUPL

View File

@ -5,7 +5,7 @@ require "openssl"
require "jwt"
require "passwd"
require "ipc"
require "fs"
require "dodb"
require "./authd.cr"
@ -86,7 +86,7 @@ class AuthD::Service
return Response::Error.new "invalid token" unless user
storage = FS::Hash(String, JSON::Any).new "#{@extras_root}/#{user.uid}"
storage = DODB::DataBase(String, JSON::Any).new "#{@extras_root}/#{user.uid}"
Response::Extra.new user.uid, request.name, storage[request.name]?
when Request::SetExtra
@ -94,7 +94,7 @@ class AuthD::Service
return Response::Error.new "invalid token" unless user
storage = FS::Hash(String, JSON::Any).new "#{@extras_root}/#{user.uid}"
storage = DODB::DataBase(String, JSON::Any).new "#{@extras_root}/#{user.uid}"
storage[request.name] = request.extra