Skip to content

Commit 717062f

Browse files
committed
fix(auth): allow trailing slash for start urls
Might fix cases for some users reporting that the auth screen is not accepting their start url. May or may not fix #5412
1 parent f247601 commit 717062f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/core/src/login/webview/vue/login.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ type Stage = 'START' | 'SSO_FORM' | 'CONNECTED' | 'AUTHENTICATING' | 'AWS_PROFIL
286286
287287
function validateSsoUrlFormat(url: string) {
288288
const regex =
289-
/^(https?:\/\/(.+)\.awsapps\.com\/start|https?:\/\/identitycenter\.amazonaws\.com\/ssoins-[\da-zA-Z]{16})$/
289+
/^(https?:\/\/(.+)\.awsapps\.com\/start|https?:\/\/identitycenter\.amazonaws\.com\/ssoins-[\da-zA-Z]{16})\/?$/
290290
return regex.test(url)
291291
}
292292
@@ -484,7 +484,7 @@ export default defineComponent({
484484
if (this.startUrl && !validateSsoUrlFormat(this.startUrl)) {
485485
this.startUrlError =
486486
'URLs must start with http:// or https://. Example: https://d-xxxxxxxxxx.awsapps.com/start'
487-
} else if (this.startUrl && this.existingStartUrls.some(url => url === this.startUrl)) {
487+
} else if (this.startUrl && this.existingStartUrls.some((url) => url === this.startUrl)) {
488488
this.startUrlError =
489489
'A connection for this start URL already exists. Sign out before creating a new one.'
490490
} else {
@@ -520,7 +520,7 @@ export default defineComponent({
520520
// to reuse connections in AWS Toolkit & Amazon Q
521521
const sharedConnections = await client.fetchConnections()
522522
sharedConnections
523-
?.filter(c => !this.existingStartUrls.includes(c.startUrl))
523+
?.filter((c) => !this.existingStartUrls.includes(c.startUrl))
524524
.forEach((connection, index) => {
525525
this.importedLogins.push({
526526
id: LoginOption.IMPORTED_LOGINS + index,
@@ -535,7 +535,7 @@ export default defineComponent({
535535
this.$forceUpdate()
536536
},
537537
async updateExistingStartUrls() {
538-
this.existingStartUrls = (await client.listSsoConnections()).map(conn => conn.startUrl)
538+
this.existingStartUrls = (await client.listSsoConnections()).map((conn) => conn.startUrl)
539539
},
540540
async getDefaultStartUrl() {
541541
return await client.getDefaultStartUrl()

0 commit comments

Comments
 (0)