Google Auth doesn't work with ApprootRelative

37 views
Skip to first unread message

Hugo Gomes

unread,
Oct 9, 2012, 12:36:02 PM10/9/12
to yeso...@googlegroups.com
Hi,

I noticed that Google auth isn't working when approot = ApprootRelative, is this intended ?

Is it possible to set ApprootRelative to only some routes ?

Thanks

Michael Snoyman

unread,
Oct 10, 2012, 2:10:18 AM10/10/12
to yeso...@googlegroups.com
This is a known issue. If you look at the comments on `approot`[1], it says that the ApprootRelative default is valid if:

You do not use any features that require absolute URLs, such as Atom feeds and XML sitemaps.

OpenID is another feature (by design of the standard) that requires absolute URLs, which is why it won't work. Same goes for BrowserID.

Michael

Hugo Gomes

unread,
Oct 12, 2012, 7:13:27 AM10/12/12
to yeso...@googlegroups.com
Thanks,

i got it working by letting appRoot set as appRoot = ApprootMaster $ appRoot . settings

and then specifying relative urls for the routes i wanted to be always relative in urlRenderOverride, like this:

urlRenderOverride y r@(ProfileMainR _) = Just $ relativeUrl y r
urlRenderOverride y r@(OtherRouteR _) = Just $ relativeUrl y r
urlRenderOverride _ _ = Nothing

where relativeUrl is:
relativeUrl :: forall a a1. (RenderRoute a1, Yesod a)
            => a
            -> Route a1
            -> Blaze.ByteString.Builder.Internal.Builder
relativeUrl y r = uncurry (joinPath y "") $ renderRoute r

Thanks :)

2012/10/10 Michael Snoyman <mic...@snoyman.com>
Reply all
Reply to author
Forward
0 new messages