templates/authorize.str in rodauth-oauth-1.0.0.pre.beta1 vs templates/authorize.str in rodauth-oauth-1.0.0.pre.beta2
- old
+ new
@@ -7,16 +7,17 @@
HTML
end
}
<p class="lead">
#{
- rodauth.authorize_page_lead(name: <<-LINK
- <a target="_blank" href="#{h(rodauth.oauth_application[rodauth.oauth_applications_homepage_url_column])}">
+ application_uri = rodauth.oauth_application[rodauth.oauth_applications_homepage_url_column]
+ application_name = application_uri ? (<<-LINK) : rodauth.oauth_application[rodauth.oauth_applications_name_column]
+ <a target="_blank" href="#{h(application_uri)}">
#{h(rodauth.oauth_application[rodauth.oauth_applications_name_column])}
</a>
LINK
- )
+ rodauth.authorize_page_lead(name: application_name)
}
</p>
<div class="list-group">
#{
if rodauth.oauth_application[rodauth.oauth_applications_tos_uri_column]
@@ -58,16 +59,20 @@
<div class="form-group">
<h1 class="display-6">#{rodauth.oauth_grants_scopes_label}</h1>
#{
rodauth.authorize_scopes.map do |scope|
- <<-HTML
- <div class="form-check">
- <input id="#{scope}" class="form-check-input" type="checkbox" name="scope[]" value="#{h(scope)}">
- <label class="form-check-label" for="#{scope}">#{h(scope)}</label>
- </div>
- HTML
+ if rodauth.features.include?(:oidc) && scope == "offline_access"
+ "<input type=\"hidden\" name=\"scope[]\" value=\"#{scope}\" />"
+ else
+ <<-HTML
+ <div class="form-check">
+ <input id="#{scope}" class="form-check-input" type="checkbox" name="scope[]" value="#{h(scope)}">
+ <label class="form-check-label" for="#{scope}">#{h(scope)}</label>
+ </div>
+ HTML
+ end
end.join
}
<input type="hidden" name="client_id" value="#{rodauth.param("client_id")}"/>
#{"<input type=\"hidden\" name=\"access_type\" value=\"#{rodauth.param("access_type")}\"/>" if rodauth.param_or_nil("access_type")}
@@ -75,13 +80,15 @@
#{"<input type=\"hidden\" name=\"response_mode\" value=\"#{rodauth.param("response_mode")}\"/>" if rodauth.param_or_nil("response_mode")}
#{"<input type=\"hidden\" name=\"state\" value=\"#{rodauth.param("state")}\"/>" if rodauth.param_or_nil("state")}
#{"<input type=\"hidden\" name=\"redirect_uri\" value=\"#{rodauth.redirect_uri}\"/>" if rodauth.param_or_nil("redirect_uri")}
#{"<input type=\"hidden\" name=\"code_challenge\" value=\"#{rodauth.param("code_challenge")}\"/>" if rodauth.features.include?(:oauth_pkce) && rodauth.param_or_nil("code_challenge")}
#{"<input type=\"hidden\" name=\"code_challenge_method\" value=\"#{rodauth.param("code_challenge_method")}\"/>" if rodauth.features.include?(:oauth_pkce) && rodauth.param_or_nil("code_challenge_method")}
+ #{"<input type=\"hidden\" name=\"prompt\" value=\"#{rodauth.param("prompt")}\"/>" if rodauth.features.include?(:oidc) && rodauth.param_or_nil("prompt")}
#{"<input type=\"hidden\" name=\"nonce\" value=\"#{rodauth.param("nonce")}\"/>" if rodauth.features.include?(:oidc) && rodauth.param_or_nil("nonce")}
#{"<input type=\"hidden\" name=\"ui_locales\" value=\"#{rodauth.param("ui_locales")}\"/>" if rodauth.features.include?(:oidc) && rodauth.param_or_nil("ui_locales")}
#{"<input type=\"hidden\" name=\"claims_locales\" value=\"#{rodauth.param("claims_locales")}\"/>" if rodauth.features.include?(:oidc) && rodauth.param_or_nil("claims_locales")}
- #{"<input type=\"hidden\" name=\"acr\" value=\"#{rodauth.param("acr_values")}\"/>" if rodauth.features.include?(:oidc) && rodauth.param_or_nil("acr_values")}
+ #{"<input type=\"hidden\" name=\"claims\" value=\"#{h(rodauth.param("claims"))}\"/>" if rodauth.features.include?(:oidc) && rodauth.param_or_nil("claims")}
+ #{"<input type=\"hidden\" name=\"acr_values\" value=\"#{rodauth.param("acr_values")}\"/>" if rodauth.features.include?(:oidc) && rodauth.param_or_nil("acr_values")}
#{
if rodauth.features.include?(:oauth_resource_indicators) && rodauth.resource_indicators
rodauth.resource_indicators.map do |resource|
"<input type=\"hidden\" name=\"resource\" value=\"#{resource}\"/>"
end.join