api: Updates for Nim 1.4.x.
This commit is contained in:
@ -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)
|
||||
|
@ -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))
|
||||
|
||||
|
Reference in New Issue
Block a user