api: Updates for Nim 1.4.x.

This commit is contained in:
2021-07-03 01:26:56 -05:00
parent 526419afb3
commit 1449e1ffdd
3 changed files with 5 additions and 5 deletions

View File

@ -97,7 +97,7 @@ proc fromJWT*(ctx: PMApiContext, strTok: string): Session =
## Validate a given JWT and extract the session data.
let jwt = toJWT(strTok)
var secret = ctx.cfg.authSecret
if not jwt.verify(secret): raiseEx "Unable to verify auth token."
if not jwt.verify(secret, HS256): raiseEx "Unable to verify auth token."
jwt.verifyTimeClaims()
# Find the user record (if authenticated)

View File

@ -1,4 +1,4 @@
import db_postgres, fiber_orm, uuids
import db_postgres, fiber_orm, sequtils, uuids
import ./models
@ -8,7 +8,7 @@ type
PMApiDb* = ref object
conn: DbConn
proc connect*(connString: string): PMApiDb =
result = PMApiDb(conn: open("", "", "", connString))