fusionauth-issues
fusionauth-issues copied to clipboard
Can't use a consent in the self-service edit form
Can't use a consent in the self-service edit form
Description
If you create a registration process with a consent, you can't use the profile edit form. There's an exception.
Affects versions
1.40.2
Steps to reproduce
Steps to reproduce the behavior:
- create a consent
- create a form field referencing that consent
- create a custom registration form referencing that consent
- create a custom self service form referencing that consent
- create an application
- enable authorization code grant and provide redirect urls for this application
- enable advanced self-service registration on that application, using the custom registration form created above
- enable User Self-service using the customer self service form created above
- save the application
- view the application
- copy the registration url
- open an incognito window
- go to the registration url
- register a user. the consent renders fine
- switch back to the other window
- copy the profile url
- switch back to the incognito window
- visit the profile url
- edit your profile
- see exception
Exception:
A FreeMarker exception occurred. See the FusionAuth Event Log for additional details.
Expected behavior
You can add or remove consent using the FusionAuth provided profile edit screen
Community guidelines
All issues filed in this repository must abide by the FusionAuth community guidelines.
Additional context
It looks like the consents
object is never set. Printing it out results in the same error.
Verified this on the sandbox.
Event log output:
A FreeMarker exception occurred.
Exception:
FreeMarker template error:
The following has evaluated to null or missing:
==> consents [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/_helpers.ftl" at line 840, column 26]
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: #local checked = consents(field.conse... [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/_helpers.ftl" in macro "checkbox" at line 840, column 8]
- Reached through: @checkbox field=field id="${fieldId}"... [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/_helpers.ftl" in macro "customField" at line 968, column 7]
- Reached through: @helpers.customField field=field key=... [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/account/edit.ftl" at line 56, column 24]
~ Reached through: #nested [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/_helpers.ftl" in macro "accountPanel" at line 288, column 9]
~ Reached through: @helpers.accountPanel title="" tenant... [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/account/edit.ftl" at line 36, column 7]
~ Reached through: #nested [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/_helpers.ftl" in macro "accountMain" at line 211, column 7]
~ Reached through: @helpers.accountMain rowClass="row ce... [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/account/edit.ftl" at line 35, column 5]
~ Reached through: #nested [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/_helpers.ftl" in macro "body" at line 131, column 3]
~ Reached through: @helpers.body [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/account/edit.ftl" at line 29, column 3]
~ Reached through: #nested [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/_helpers.ftl" in macro "html" at line 31, column 3]
~ Reached through: @helpers.html [in template "##42a82ca6-85d5-450f-8be3-ae2323bd2d37##templates/account/edit.ftl" at line 27, column 1]
----
Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
at freemarker.core.UnexpectedTypeException.newDescriptionBuilder(UnexpectedTypeException.java:85)
at freemarker.core.UnexpectedTypeException.<init>(UnexpectedTypeException.java:63)
at freemarker.core.NonMethodException.<init>(NonMethodException.java:74)
at freemarker.core.MethodCall._eval(MethodCall.java:67)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.ExistsExpression._eval(ExistsExpression.java:49)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.Assignment.accept(Assignment.java:134)
at freemarker.core.Environment.visit(Environment.java:334)
at freemarker.core.Environment.visit(Environment.java:376)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876)
at freemarker.core.Environment.invokeMacro(Environment.java:812)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:334)
at freemarker.core.Environment.visit(Environment.java:340)
at freemarker.core.Environment.visit(Environment.java:376)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876)
at freemarker.core.Environment.invokeMacro(Environment.java:812)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:334)
at freemarker.core.Environment.visit(Environment.java:376)
at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:291)
at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:644)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
at freemarker.core.Environment.visit(Environment.java:370)
at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForHashListing(IteratorBlock.java:383)
at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:272)
at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:644)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
at freemarker.core.Environment.visit(Environment.java:334)
at freemarker.core.Environment.visit(Environment.java:376)
at freemarker.core.Environment.invokeNestedContent(Environment.java:620)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:60)
at freemarker.core.Environment.visit(Environment.java:370)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876)
at freemarker.core.Environment.invokeMacro(Environment.java:812)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:370)
at freemarker.core.Environment.invokeNestedContent(Environment.java:620)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:60)
at freemarker.core.Environment.visit(Environment.java:370)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876)
at freemarker.core.Environment.invokeMacro(Environment.java:812)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:370)
at freemarker.core.Environment.invokeNestedContent(Environment.java:620)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:60)
at freemarker.core.Environment.visit(Environment.java:370)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876)
at freemarker.core.Environment.invokeMacro(Environment.java:812)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:370)
at freemarker.core.Environment.invokeNestedContent(Environment.java:620)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:60)
at freemarker.core.Environment.visit(Environment.java:370)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876)
at freemarker.core.Environment.invokeMacro(Environment.java:812)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:334)
at freemarker.core.Environment.visit(Environment.java:340)
at freemarker.core.Environment.process(Environment.java:313)
at freemarker.template.Template.process(Template.java:383)
at org.primeframework.mvc.freemarker.DefaultFreeMarkerService.render(DefaultFreeMarkerService.java:76)
at org.primeframework.mvc.action.result.AbstractForwardResult.execute(AbstractForwardResult.java:92)
at org.primeframework.mvc.action.result.DefaultResultInvocationWorkflow.perform(DefaultResultInvocationWorkflow.java:106)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.scope.DefaultScopeStorageWorkflow.perform(DefaultScopeStorageWorkflow.java:61)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.action.DefaultActionInvocationWorkflow.perform(DefaultActionInvocationWorkflow.java:64)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.message.DefaultMessageWorkflow.perform(DefaultMessageWorkflow.java:50)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.validation.DefaultValidationWorkflow.perform(DefaultValidationWorkflow.java:45)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.security.DefaultSecurityWorkflow.perform(DefaultSecurityWorkflow.java:59)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.parameter.DefaultPostParameterWorkflow.perform(DefaultPostParameterWorkflow.java:49)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.content.DefaultContentWorkflow.perform(DefaultContentWorkflow.java:72)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.parameter.DefaultParameterWorkflow.perform(DefaultParameterWorkflow.java:56)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.parameter.DefaultURIParameterWorkflow.perform(DefaultURIParameterWorkflow.java:92)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.scope.DefaultScopeRetrievalWorkflow.perform(DefaultScopeRetrievalWorkflow.java:50)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.action.DefaultActionMappingWorkflow.perform(DefaultActionMappingWorkflow.java:113)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.security.DefaultSavedRequestWorkflow.perform(DefaultSavedRequestWorkflow.java:66)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.cors.CORSRequestWorkflow.perform(CORSRequestWorkflow.java:65)
at org.primeframework.mvc.workflow.SubWorkflowChain.continueWorkflow(SubWorkflowChain.java:50)
at org.primeframework.mvc.workflow.DefaultMVCWorkflow.perform(DefaultMVCWorkflow.java:108)
at org.primeframework.mvc.PrimeMVCRequestHandler.handleRequest(PrimeMVCRequestHandler.java:62)
at org.primeframework.mvc.netty.PrimeHTTPServerHandler.channelRead0(PrimeHTTPServerHandler.java:176)
at org.primeframework.mvc.netty.PrimeHTTPServerHandler.channelRead0(PrimeHTTPServerHandler.java:80)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)
at io.netty.handler.codec.http.HttpServerKeepAliveHandler.channelRead(HttpServerKeepAliveHandler.java:64)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)