@@ -37,26 +37,32 @@ import (
3737func handleConsent (ctx * fiber.Ctx , info * pkg2.OIDCFlowRequest , includeConsentCallbacks bool ) error {
3838 c := info .Capabilities
3939 binding := map [string ]interface {}{
40- "consent" : true ,
41- "consent-send" : includeConsentCallbacks ,
42- "empty-navbar" : true ,
43- "restr-gui" : true ,
44- "collapse" : templating.Collapsable {All : true },
45- "restrictions" : pkg.WebRestrictions {Restrictions : info .Restrictions },
46- "capabilities" : pkg .AllWebCapabilities (),
47- "subtoken-capabilities" : pkg .AllWebCapabilities (),
48- "checked-capabilities" : c .Strings (),
49- "iss" : info .Issuer ,
50- "supported_scopes" : strings .Join (config .Get ().ProviderByIssuer [info .Issuer ].Scopes , " " ),
51- "token-name" : info .Name ,
52- "rotation" : info .Rotation ,
53- "application" : info .ApplicationName ,
40+ templating .MustacheKeyConsent : true ,
41+ templating .MustacheKeyConsentSend : includeConsentCallbacks ,
42+ templating .MustacheKeyEmptyNavbar : true ,
43+ templating .MustacheKeyRestrictionsGUI : true ,
44+ templating .MustacheKeyCollapse : templating.Collapsable {All : true },
45+ templating .MustacheKeyRestrictions : pkg.WebRestrictions {Restrictions : info .Restrictions },
46+ templating .MustacheKeyCapabilities : pkg .AllWebCapabilities (),
47+ templating .MustacheKeySubtokenCapabilities : pkg .AllWebCapabilities (),
48+ templating .MustacheKeyCheckedCapabilities : c .Strings (),
49+ templating .MustacheKeyIss : info .Issuer ,
50+ templating .MustacheKeySupportedScopes : strings .Join (
51+ config .Get ().ProviderByIssuer [info .Issuer ].Scopes , " " ,
52+ ),
53+ templating .MustacheKeyTokenName : info .Name ,
54+ templating .MustacheKeyRotation : info .Rotation ,
55+ templating .MustacheKeyApplication : info .ApplicationName ,
5456 }
5557 if c .Has (api .CapabilityCreateMT ) {
56- binding ["checked-subtoken-capabilities" ] = info .SubtokenCapabilities .Strings ()
58+ binding [templating . MustacheKeyCheckedSubtokenCapabilities ] = info .SubtokenCapabilities .Strings ()
5759 }
5860 if ! includeConsentCallbacks {
59- binding ["instance-url" ] = config .Get ().IssuerURL
61+ iss := config .Get ().IssuerURL
62+ if iss [len (iss )- 1 ] == '/' {
63+ iss = iss [:len (iss )- 1 ]
64+ }
65+ binding [templating .MustacheKeyInstanceUrl ] = iss
6066 }
6167 return ctx .Render ("sites/consent" , binding , "layouts/main" )
6268}
0 commit comments