Updated code to match more recent dependencies.
parent
2805356791
commit
4b94f72962
|
@ -24,8 +24,8 @@ dependencies:
|
||||||
jwt:
|
jwt:
|
||||||
github: crystal-community/jwt
|
github: crystal-community/jwt
|
||||||
branch: master
|
branch: master
|
||||||
fs:
|
dodb:
|
||||||
git: https://git.karchnu.fr/WeirdOS/fs.cr
|
git: https://git.karchnu.fr/WeirdOS/dodb.cr
|
||||||
branch: master
|
branch: master
|
||||||
|
|
||||||
license: EUPL
|
license: EUPL
|
||||||
|
|
|
@ -5,7 +5,7 @@ require "openssl"
|
||||||
require "jwt"
|
require "jwt"
|
||||||
require "passwd"
|
require "passwd"
|
||||||
require "ipc"
|
require "ipc"
|
||||||
require "fs"
|
require "dodb"
|
||||||
|
|
||||||
require "./authd.cr"
|
require "./authd.cr"
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ class AuthD::Service
|
||||||
|
|
||||||
return Response::Error.new "invalid token" unless user
|
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]?
|
Response::Extra.new user.uid, request.name, storage[request.name]?
|
||||||
when Request::SetExtra
|
when Request::SetExtra
|
||||||
|
@ -94,7 +94,7 @@ class AuthD::Service
|
||||||
|
|
||||||
return Response::Error.new "invalid token" unless user
|
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
|
storage[request.name] = request.extra
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue