Skip to content

Commit 37930fb

Browse files
committed
If authority segments <3, throw
1 parent d00ce0d commit 37930fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/internal/oauth/ops/authority/authority.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ func NewInfoFromAuthorityURI(authority string, validateAuthority bool, instanceD
362362
cannonicalAuthority := authority
363363

364364
// suffix authority with / if it doesn't have one
365-
if !strings.HasSuffix(authority, "/") {
365+
if !strings.HasSuffix(cannonicalAuthority, "/") {
366366
cannonicalAuthority += "/"
367367
}
368368

@@ -376,7 +376,7 @@ func NewInfoFromAuthorityURI(authority string, validateAuthority bool, instanceD
376376
}
377377

378378
pathParts := strings.Split(u.EscapedPath(), "/")
379-
if len(pathParts) < 2 {
379+
if len(pathParts) < 3 {
380380
return Info{}, errors.New(`authority must be an URL such as "https://login.microsoftonline.com/<your tenant>"`)
381381
}
382382

0 commit comments

Comments
 (0)