mirror of
https://github.com/glimpse-app/server.git
synced 2025-04-02 10:52:45 -04:00
newsession returns json
This commit is contained in:
parent
019cf31922
commit
37ad2d6a67
1 changed files with 9 additions and 1 deletions
|
@ -64,4 +64,12 @@ proc createAuthenticationRoutes*() =
|
|||
db.generateToken(user)
|
||||
else:
|
||||
resp Http403, "Incorrect username or password.\n" # fails if password is wrong but mentions username to obfuscates if a user exists or not
|
||||
resp Http200, user.token & "\n"
|
||||
|
||||
var userToken: string
|
||||
with userToken:
|
||||
add "[{"
|
||||
add("\"token\": \"" & user.token & "\"")
|
||||
add "}]"
|
||||
|
||||
resp Http200, userToken & "\n", "application/json"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue