Skip to content

Commit

Permalink
Update user_model.ml
Browse files Browse the repository at this point in the history
Co-authored-by: Hannes Mehnert <hannes@mehnert.org>
  • Loading branch information
PizieDust and hannesm authored Jul 3, 2024
1 parent 42c6471 commit 2782599
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions user_model.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,9 @@ let user_to_json u : Yojson.Basic.t =
]

let encrypt_password password uuid =
let enc = Mirage_crypto.Hash.SHA256.digest
let hash = Mirage_crypto.Hash.SHA256.digest
(Cstruct.of_string (uuid ^ "-" ^ password)) in
match Base64.encode (Cstruct.to_string enc) with
| Error (`Msg s) ->
Logs.warn (fun m ->
m "Failed to generate user token for: %s" s);
None
| Ok pass -> Some pass
Base64.encode_string (Cstruct.to_string hash)

let generate_uuid () =
let data = Rng.generate 16 in
Expand Down

0 comments on commit 2782599

Please sign in to comment.