Skip to content

Commit

Permalink
Add some comments on the newly added code
Browse files Browse the repository at this point in the history
  • Loading branch information
deepjyoti30-st committed Oct 2, 2024
1 parent 81a062f commit 4449b38
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recipe/dashboard/api/implementation.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,18 @@ func MakeAPIImplementation() dashboardmodels.APIInterface {
return "", err
}

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

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

0 comments on commit 4449b38

Please sign in to comment.