You need to sign in to do that
Don't have an account?
Gaurav Jain 7
Trailhead - Developer Advanced -- App Logic Vulnerability Prevention -- Prevent Open Redirects in Your Code
Hi All,
Unable to pass App Logic Vulnerability Prevention -- Prevent Open Redirects in Your Code module:
please see the below code:
Thanks in advance
Unable to pass App Logic Vulnerability Prevention -- Prevent Open Redirects in Your Code module:
please see the below code:
public PageReference save(){ PageReference savePage; if (Schema.SObjectType.Resource_Type__c.isCreateable()){ try{ insert rtype; String completion = ApexPages.currentPage().getParameters().get('finishURL'); if(completion.startsWith('/')){ completion.replaceFirst('/',''); savePage = new PageReference('/'+completion); } else { savePage = new PageReference(completion); } savePage.setRedirect(true); return savePage; }catch (exception e){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'Unable to update requisitions. Exception: ' + e.getMessage())); return null; } }else{ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'You do not have permission to update requisitions')); return null; } }
Thanks in advance
Please check with below link from the forums community with a similar issue which might help you further.
- https://developer.salesforce.com/forums/?id=9060G000000I48wQAC
Please let us know if this helps.Thanks,
Nagendra
really does nothing for you. You want the return value. So do this instead;