Skip to content

Commit 304148b

Browse files
committed
Make ApiKey string
1 parent c39693d commit 304148b

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

recipe/dashboard/api/signOutPost.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type signOutPostResponse struct {
1111
}
1212

1313
func SignOutPost(apiInterface dashboardmodels.APIInterface, options dashboardmodels.APIOptions) (signOutPostResponse, error) {
14-
if options.Config.ApiKey != nil {
14+
if options.Config.ApiKey != "" {
1515
return signOutPostResponse{
1616
Status: "OK",
1717
}, nil

recipe/dashboard/dashboardmodels/models.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package dashboardmodels
1717

1818
type TypeInput struct {
19-
ApiKey *string
19+
ApiKey string
2020
Override *OverrideStruct
2121
}
2222

@@ -28,7 +28,7 @@ const (
2828
)
2929

3030
type TypeNormalisedInput struct {
31-
ApiKey *string
31+
ApiKey string
3232
AuthMode TypeAuthMode
3333
Override OverrideStruct
3434
}

recipe/dashboard/recipeimplementation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func makeRecipeImplementation(querier supertokens.Querier) dashboardmodels.Recip
3131
}
3232

3333
shouldAllowAccess := func(req *http.Request, config dashboardmodels.TypeNormalisedInput, userContext supertokens.UserContext) (bool, error) {
34-
if config.ApiKey == nil {
34+
if config.ApiKey == "" {
3535
authHeaderValue := req.Header.Get("authorization")
3636
// We receive the api key as `Bearer API_KEY`, this retrieves just the key
3737
keyParts := strings.Split(authHeaderValue, " ")

recipe/dashboard/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
func validateAndNormaliseUserInput(appInfo supertokens.NormalisedAppinfo, config *dashboardmodels.TypeInput) dashboardmodels.TypeNormalisedInput {
2727
typeNormalisedInput := makeTypeNormalisedInput(appInfo)
2828

29-
if config.ApiKey != nil {
29+
if config.ApiKey != "" {
3030
typeNormalisedInput.ApiKey = config.ApiKey
3131
typeNormalisedInput.AuthMode = dashboardmodels.AuthModeAPIKey
3232
}

recipe/dashboard/validationUtils/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ func ValidateApiKey(req *http.Request, config dashboardmodels.TypeNormalisedInpu
1818
return false, nil
1919
}
2020

21-
return apiKeyHeaderValue == *config.ApiKey, nil
21+
return apiKeyHeaderValue == config.ApiKey, nil
2222
}

0 commit comments

Comments
 (0)