Skip to content

Commit 4449b38

Browse files
Add some comments on the newly added code
1 parent 81a062f commit 4449b38

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

recipe/dashboard/api/implementation.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,18 @@ func MakeAPIImplementation() dashboardmodels.APIInterface {
4747
return "", err
4848
}
4949

50+
// We are splitting the passed URI here so that if multiple URI's are passed
51+
// separated by a colon, the first one is returned.
5052
connectionURIToNormalize := strings.Split(stInstance.SuperTokens.ConnectionURI, ";")[0]
5153

54+
// This normalizes the URI to make sure that it has things like protocol etc
55+
// injected into it before it is returned.
5256
var normalizationError error
5357
normalizedConnectionURI, normalizationError := supertokens.NewNormalisedURLDomain(connectionURIToNormalize)
5458
if normalizationError != nil {
59+
// In case of failures, we want to return a 500 here, mainly because that
60+
// is what we return if the connectionURI is invalid which is the case here
61+
// if normalization fails.
5562
return "", normalizationError
5663
}
5764
connectionURI := normalizedConnectionURI.GetAsStringDangerous()

0 commit comments

Comments
 (0)