diff options
| -rw-r--r-- | main.scm | 7 | ||||
| -rw-r--r-- | makefile | 1 | 
2 files changed, 4 insertions, 4 deletions
| @@ -112,14 +112,13 @@  (define (parent-id p) (fifth p))  (define (children-count p) (sixth p)) - -(define users (alist->hash-table '(("lawrence" . "pw") ("demo" . "pw") ("dan" . "pw")))) +(define users (alist->hash-table `(("example" . ,(crypt "pw")))))  (define apikeys (make-hash-table))  (define (login username password) -  (let ([pw-in-db (hash-table-ref/default users username #f)]) -    (and password (equal? password pw-in-db) +  (let ([pw-hash-in-db (hash-table-ref/default users username #f)]) +    (and password (string=? (crypt password pw-hash-in-db) pw-hash-in-db)           (let ([apikey (number->string (pseudo-random-integer 340282366920938463463374607431768211455))])             (hash-table-set! apikeys apikey username)             apikey)))) @@ -6,6 +6,7 @@ build: ./main.scm build-cpp  #		-C -Ilib/  	chicken-csc -static ./main.scm \  		-L -lsqlite3 \ +		-L -lcrypt \  		-L lib/exif_wrapper.o \  		-L /lib/libexiv2.so \  		-L /usr/lib/libstdc++.so.6 \ | 
