@@ -68,7 +68,6 @@ const OAUTH_MESSAGES = {
6868 permissions_required : 'All requested permissions are required to connect this account.' ,
6969 configuration_changed : 'This credential option changed. Reload the page and try again.' ,
7070 rate_limited : 'Too many authorization attempts. Wait a few minutes and try again.' ,
71- incomplete : 'Connect every account before submitting.' ,
7271 unavailable : 'Account authorization is temporarily unavailable. Please try again.' ,
7372 failed : 'Account authorization did not complete. Please try again.' ,
7473} as const
@@ -109,7 +108,6 @@ export default async function CredentialGroupEnrollmentPage({
109108 const resolvedSearchParams = await searchParams
110109 const oauthStatus = getSearchParam ( resolvedSearchParams , 'oauth' )
111110 const connectedOptionId = getSearchParam ( resolvedSearchParams , 'connected' )
112- const submitted = getSearchParam ( resolvedSearchParams , 'submitted' )
113111 const oauthMessage =
114112 oauthStatus && oauthStatus in OAUTH_MESSAGES
115113 ? OAUTH_MESSAGES [ oauthStatus as keyof typeof OAUTH_MESSAGES ]
@@ -118,22 +116,14 @@ export default async function CredentialGroupEnrollmentPage({
118116 const connectedOption = connectedOptionId
119117 ? activeOptions . find ( ( option ) => option . id === connectedOptionId )
120118 : undefined
121- const notification = submitted
122- ? { message : 'Accounts submitted successfully.' , variant : 'success' as const }
123- : connectedOptionId
124- ? {
125- message : `${ connectedOption ? getCredentialGroupProviderService ( connectedOption . provider ) . name : 'Account' } connected successfully.` ,
126- variant : 'success' as const ,
127- }
128- : oauthMessage
129- ? { message : oauthMessage , variant : 'error' as const }
130- : null
131- const allConnected =
132- activeOptions . length > 0 &&
133- activeOptions . every (
134- ( option ) => option . connections . length === 1 && option . connections [ 0 ] ?. status === 'connected'
135- )
136-
119+ const notification = connectedOptionId
120+ ? {
121+ message : `${ connectedOption ? getCredentialGroupProviderService ( connectedOption . provider ) . name : 'Account' } connected successfully.` ,
122+ variant : 'success' as const ,
123+ }
124+ : oauthMessage
125+ ? { message : oauthMessage , variant : 'error' as const }
126+ : null
137127 return (
138128 < PageShell >
139129 { notification && (
@@ -167,24 +157,23 @@ export default async function CredentialGroupEnrollmentPage({
167157 trailing = {
168158 < OAuthConnectLink
169159 href = { `/api/credential-groups/enroll/${ token } /oauth/${ option . id } ` }
160+ reconnect = { Boolean ( connection ) }
170161 />
171162 }
172163 />
173164 )
174165 } ) }
175166 </ div >
176167 </ SettingsSection >
177- { ( allConnected || enrollment . status === 'completed' ) && (
178- < form
179- action = { `/api/credential-groups/enroll/${ token } /complete` }
180- method = 'post'
181- className = 'mt-6 flex justify-end'
182- >
183- < Chip type = 'submit' variant = 'primary' disabled = { enrollment . status === 'completed' } >
184- { enrollment . status === 'completed' ? 'Submitted' : 'Submit' }
185- </ Chip >
186- </ form >
187- ) }
168+ < form
169+ action = { `/api/credential-groups/enroll/${ token } /complete` }
170+ method = 'post'
171+ className = 'mt-6 flex justify-end'
172+ >
173+ < Chip type = 'submit' variant = 'primary' disabled = { enrollment . status === 'completed' } >
174+ { enrollment . status === 'completed' ? 'Submitted' : 'Submit' }
175+ </ Chip >
176+ </ form >
188177 </ div >
189178 </ PageShell >
190179 )
0 commit comments