Skip to content

Commit

Permalink
feat: change to Spontaneous Scope should not be allowed #334
Browse files Browse the repository at this point in the history
  • Loading branch information
duttarnab committed Jul 27, 2022
1 parent b89b911 commit 314a2a8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions admin-ui/plugins/auth-server/components/Scopes/ScopeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit}) {
const selectedTheme = theme.state.theme
const history = useHistory()
const spontaneousClientScopes = scope.attributes.spontaneousClientScopes || []
const [options, setOptions] = useState();
const dispatch = useDispatch()
const client = useSelector((state) => state.oidcReducer.items)
let claims = []
Expand All @@ -63,16 +62,15 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit}) {

useEffect(() => {
if (showSpontaneousPanel) {
makeOptions(1, scope.attributes.spontaneousClientId)
dispatch(searchClients({ "action_data": options }))
dispatch(searchClients({ "action_data": makeOptions(1, scope.attributes.spontaneousClientId) }))
}
}, [showClaimsPanel])

const makeOptions = (limit, client_id) => {
let obj = {}
obj[LIMIT] = limit
obj[PATTERN] = client_id
setOptions(obj);
return obj
}

const handleScopeTypeChanged = (type) => {
Expand Down Expand Up @@ -342,7 +340,7 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit}) {
<IconButton onClick={() => goToClientViewPage(scope.attributes.spontaneousClientId)}>
<Visibility />
</IconButton>
</div>
</div>
</Col>
</FormGroup>
</GluuTooltip>
Expand Down

0 comments on commit 314a2a8

Please sign in to comment.