Update project name in strings

Fixes #105
This commit is contained in:
Joe Nelson
2014-12-17 10:24:24 -08:00
parent 5f4212e2fd
commit dbe1f59066
15 changed files with 167 additions and 166 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ app reqBody req =
)
] (cs $ fromMaybe "[]" body)
(["dbapi", "users"], "POST") -> do
(["postgrest", "users"], "POST") -> do
let user = decode reqBody :: Maybe AuthUser
case user of
@@ -94,7 +94,7 @@ app reqBody req =
(cs $ userPass u) (cs $ userRole u)
return $ responseLBS status201
[ jsonH
, (hLocation, "/dbapi/users?id=eq." <> cs (userId u))
, (hLocation, "/postgrest/users?id=eq." <> cs (userId u))
] ""
([table], "POST") ->
+2 -2
View File
@@ -55,12 +55,12 @@ addUser :: Text -> Text -> Text -> H.Tx H.Postgres s ()
addUser identity pass role = do
let Just hashed = unsafePerformIO $ hashPasswordUsingPolicy fastBcryptHashingPolicy (cs pass)
H.unit $
[H.q|insert into dbapi.auth (id, pass, rolname) values (?, ?, ?)|]
[H.q|insert into postgrest.auth (id, pass, rolname) values (?, ?, ?)|]
identity (cs hashed :: Text) role
signInRole :: Text -> Text -> H.Tx H.Postgres s LoginAttempt
signInRole user pass = do
u <- H.single $ [H.q|select pass, rolname from dbapi.auth where id = ?|] user
u <- H.single $ [H.q|select pass, rolname from postgrest.auth where id = ?|] user
return $ maybe LoginFailed (\r ->
let (hashed, role) = r in
if checkPass hashed pass
+1 -1
View File
@@ -42,7 +42,7 @@ main = do
H.sessionSettings (fromIntegral $ configPool conf) 30
let appSettings = setPort port
. setServerName (cs $ "dbapi/" <> prettyVersion)
. setServerName (cs $ "postgrest/" <> prettyVersion)
$ defaultSettings
middle =
(if configSecure conf then redirectInsecure else id)