Skip to content

Commit cabea3d

Browse files
committed
fix(admin-ui): change redirect url mandatory logic
1 parent 5f065b7 commit cabea3d

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

admin-ui/plugins/auth-server/components/Clients/ClientWizardForm.js

+14-7
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@ function ClientWizardForm({
7676
setModal(!modal)
7777
}
7878
function validateFinish(){
79-
if(formRef && formRef.current && formRef.current.values.redirectUris.length > 0){
80-
toggle()
79+
if(formRef.current.values.grantTypes.includes('authorization_code') || formRef.current.values.grantTypes.includes('implicit')){
80+
if(formRef && formRef.current && formRef.current.values.redirectUris.length > 0){
81+
toggle()
82+
}else{
83+
toast.info("Please add atleast 1 redirect URL");
84+
}
8185
}else{
82-
toast.info("Please add atleast 1 redirect URL");
86+
toggle()
8387
}
8488
}
8589
function setId(index) {
@@ -89,12 +93,15 @@ function ClientWizardForm({
8993
setCurrentStep(sequence[sequence.indexOf(currentStep) - 1])
9094
}
9195
function nextStep() {
92-
if(formRef && formRef.current && formRef.current.values.redirectUris.length > 0){
93-
setCurrentStep(sequence[sequence.indexOf(currentStep) + 1])
96+
if(formRef.current.values.grantTypes.includes('authorization_code') || formRef.current.values.grantTypes.includes('implicit')){
97+
if(formRef && formRef.current && formRef.current.values.redirectUris.length > 0){
98+
setCurrentStep(sequence[sequence.indexOf(currentStep) + 1])
99+
}else{
100+
toast.info("Please add atleast 1 redirect URL");
101+
}
94102
}else{
95-
toast.info("Please add atleast 1 redirect URL");
103+
setCurrentStep(sequence[sequence.indexOf(currentStep) + 1])
96104
}
97-
98105
}
99106
function isComplete(stepId) {
100107
return sequence.indexOf(stepId) < sequence.indexOf(currentStep)

0 commit comments

Comments
 (0)