fix: login/signup flow working with session-based auth

- Fixed hashPasswordIO to use real PBKDF2 hashing from Sis.Auth
- Added seed route (rseed) for demo data initialization
- Replaced redirect() in update functions with success views
  (redirect uses throwError_ which broke with effectful 2.4)
- Added loginSuccessView and signupSuccessView with dashboard links
- Patched Hyperbole Socket.hs to parse WebSocket form body into Form params
- Patched Hyperbole Wai.hs to include TargetViewId in response metadata
- Fixed View/Page type mismatches (hyper wrapper vs plain view)
- Removed dead pure after redirect calls
- Verified: login submits, session set, success view rendered
This commit is contained in:
2026-07-16 07:27:31 -04:00
parent a99c239852
commit 456eae4717
13 changed files with 207 additions and 18 deletions
+7 -5
View File
@@ -51,6 +51,10 @@ import System.FilePath (takeDirectory)
import Text.Read (readMaybe)
import Sis.Types
import Sis.Auth (hashPassword)
import Crypto.Random.Entropy (getEntropy)
import Data.ByteString.Base64 qualified as B64
import Data.Text.Encoding qualified as TE
----------------------------------------------------------------------
-- Effect definition
@@ -369,14 +373,12 @@ generateRecurringDates period startDate fromDate toDate = go (max startDate from
next PeriodDaily = addDays 1; next PeriodWeekly = addDays 7; next PeriodMonthly = addGregorianMonthsClip 1
hashPasswordIO :: Text -> IO Text
hashPasswordIO password = do
-- Simple hashing stub — we'll use crypton via Auth.hs in the real implementation
pure password
hashPasswordIO = hashPassword
generateTokenIO :: IO Text
generateTokenIO = do
-- Simple token stub
pure "dummy-token"
bytes <- getEntropy 32
pure $ TE.decodeUtf8 $ B64.encode bytes
----------------------------------------------------------------------
-- Database open helper