(Get|Post)Token → (Get|Post)Bearer
This commit is contained in:
parent
e947921955
commit
15fa8d1130
@ -599,11 +599,11 @@ postUserNotificationR cID = do
|
|||||||
= [whamlet|
|
= [whamlet|
|
||||||
$newline never
|
$newline never
|
||||||
$maybe jwt <- mJwt
|
$maybe jwt <- mJwt
|
||||||
<input type=hidden name=#{toPathPiece PostToken} value=#{toPathPiece jwt}>
|
<input type=hidden name=#{toPathPiece PostBearer} value=#{toPathPiece jwt}>
|
||||||
^{nsInnerWdgt}
|
^{nsInnerWdgt}
|
||||||
|]
|
|]
|
||||||
|
|
||||||
formResultModal nsRes (UserNotificationR cID, [ (toPathPiece GetToken, toPathPiece jwt) | Just jwt <- pure mJwt ]) $ \ns -> do
|
formResultModal nsRes (UserNotificationR cID, [ (toPathPiece GetBearer, toPathPiece jwt) | Just jwt <- pure mJwt ]) $ \ns -> do
|
||||||
lift . runDB $ update uid [ UserNotificationSettings =. ns ]
|
lift . runDB $ update uid [ UserNotificationSettings =. ns ]
|
||||||
tell . pure =<< messageI Success MsgNotificationSettingsUpdate
|
tell . pure =<< messageI Success MsgNotificationSettingsUpdate
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,6 @@ mkEditNotifications uid = liftHandlerT $ do
|
|||||||
jwt <- encodeToken =<< bearerToken uid (Just . HashSet.singleton $ UserNotificationR cID) Nothing Nothing Nothing
|
jwt <- encodeToken =<< bearerToken uid (Just . HashSet.singleton $ UserNotificationR cID) Nothing Nothing Nothing
|
||||||
let
|
let
|
||||||
editNotificationsUrl :: SomeRoute UniWorX
|
editNotificationsUrl :: SomeRoute UniWorX
|
||||||
editNotificationsUrl = SomeRoute (UserNotificationR cID, [(toPathPiece GetToken, toPathPiece jwt)])
|
editNotificationsUrl = SomeRoute (UserNotificationR cID, [(toPathPiece GetBearer, toPathPiece jwt)])
|
||||||
editNotificationsUrl' <- toTextUrl editNotificationsUrl
|
editNotificationsUrl' <- toTextUrl editNotificationsUrl
|
||||||
return ($(ihamletFile "templates/mail/editNotifications.hamlet") :: HtmlUrlI18n UniWorXMessage (Route UniWorX))
|
return ($(ihamletFile "templates/mail/editNotifications.hamlet") :: HtmlUrlI18n UniWorXMessage (Route UniWorX))
|
||||||
|
|||||||
@ -215,6 +215,6 @@ askJwt :: forall m.
|
|||||||
-- | Retrieve current `Jwt` from HTTP-Header, POST-Parameter, or GET-Parameter
|
-- | Retrieve current `Jwt` from HTTP-Header, POST-Parameter, or GET-Parameter
|
||||||
askJwt = runMaybeT $ asum
|
askJwt = runMaybeT $ asum
|
||||||
[ MaybeT lookupBearerAuth >>= hoistMaybe . fromPathPiece
|
[ MaybeT lookupBearerAuth >>= hoistMaybe . fromPathPiece
|
||||||
, MaybeT $ lookupGlobalPostParam PostToken
|
, MaybeT $ lookupGlobalPostParam PostBearer
|
||||||
, MaybeT $ lookupGlobalGetParam GetToken
|
, MaybeT $ lookupGlobalGetParam GetBearer
|
||||||
]
|
]
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import Data.Universe
|
|||||||
import Control.Monad.Trans.Maybe (MaybeT(..))
|
import Control.Monad.Trans.Maybe (MaybeT(..))
|
||||||
|
|
||||||
|
|
||||||
data GlobalGetParam = GetReferer | GetToken
|
data GlobalGetParam = GetReferer | GetBearer
|
||||||
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
|
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
|
||||||
|
|
||||||
instance Universe GlobalGetParam
|
instance Universe GlobalGetParam
|
||||||
@ -51,7 +51,7 @@ globalGetParamField ident Field{fieldParse} = runMaybeT $ do
|
|||||||
data GlobalPostParam = PostFormIdentifier
|
data GlobalPostParam = PostFormIdentifier
|
||||||
| PostDeleteTarget
|
| PostDeleteTarget
|
||||||
| PostMassInputShape
|
| PostMassInputShape
|
||||||
| PostToken
|
| PostBearer
|
||||||
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
|
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
|
||||||
|
|
||||||
instance Universe GlobalPostParam
|
instance Universe GlobalPostParam
|
||||||
|
|||||||
Reference in New Issue
Block a user