Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
aff927b4f4 | |||
7c7695b891 |
@ -1,7 +1,7 @@
|
|||||||
## Personal Time Keeping API Interface
|
## Personal Time Keeping API Interface
|
||||||
## ===================================
|
## ===================================
|
||||||
|
|
||||||
import asyncdispatch, base64, bcrypt, cliutils, docopt, jester, json, logging,
|
import asyncdispatch, base64, bcrypt, cliutils, docopt, httpcore, jester, json, logging,
|
||||||
sequtils, strutils, os, tables, times, uuids
|
sequtils, strutils, os, tables, times, uuids
|
||||||
|
|
||||||
import nre except toSeq
|
import nre except toSeq
|
||||||
@ -61,10 +61,10 @@ template checkAuth(cfg: PtkApiCfg) =
|
|||||||
var user {.inject.}: PtkUser = PtkUser()
|
var user {.inject.}: PtkUser = PtkUser()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not request.headers.hasKey("Authorization"):
|
if not headers(request).hasKey("Authorization"):
|
||||||
raiseEx "No auth token."
|
raiseEx "No auth token."
|
||||||
|
|
||||||
let headerVal = request.headers["Authorization"]
|
let headerVal = headers(request)["Authorization"]
|
||||||
if not headerVal.startsWith("Basic "):
|
if not headerVal.startsWith("Basic "):
|
||||||
raiseEx "Invalid Authorization type (only 'Basic' is supported)."
|
raiseEx "Invalid Authorization type (only 'Basic' is supported)."
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
const PTK_VERSION* = "1.0.9"
|
const PTK_VERSION* = "1.0.11"
|
10
ptk.nimble
10
ptk.nimble
@ -1,6 +1,6 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "1.0.9"
|
version = "1.0.11"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "Personal Time Keeper"
|
description = "Personal Time Keeper"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@ -16,10 +16,10 @@ requires @[
|
|||||||
"isaac >= 0.1.3",
|
"isaac >= 0.1.3",
|
||||||
"bcrypt",
|
"bcrypt",
|
||||||
"jester 0.5.0",
|
"jester 0.5.0",
|
||||||
"https://git.jdb-labs.com/jdb/nim-lang-utils.git",
|
"https://git.jdb-software.com/jdb/nim-lang-utils.git",
|
||||||
"https://git.jdb-labs.com/jdb/nim-cli-utils.git >= 0.6.5",
|
"https://git.jdb-software.com/jdb/nim-cli-utils.git >= 0.6.5",
|
||||||
"https://git.jdb-labs.com/jdb/nim-time-utils.git >= 0.5.2",
|
"https://git.jdb-software.com/jdb/nim-time-utils.git >= 0.5.2",
|
||||||
"https://git.jdb-labs.com/jdb/update-nim-package-version"
|
"https://git.jdb-software.com/jdb/update-nim-package-version"
|
||||||
]
|
]
|
||||||
|
|
||||||
task updateVersion, "Update the version of this package.":
|
task updateVersion, "Update the version of this package.":
|
||||||
|
Reference in New Issue
Block a user