Skip to content

Commit

Permalink
added claimUserByThirdParty endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-ares committed Oct 22, 2024
1 parent d9c6305 commit 238824f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/eskimo-hut/api/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ const docTemplate = `{
}
}
},
"/v1w/auth/thirdParty/:thirdParty/claimUser/:username": {
"/v1w/auth/thirdParty/{thirdParty}/claimUser/{username}": {
"post": {
"description": "Claims the user",
"consumes": [
Expand Down
2 changes: 1 addition & 1 deletion cmd/eskimo-hut/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@
}
}
},
"/v1w/auth/thirdParty/:thirdParty/claimUser/:username": {
"/v1w/auth/thirdParty/{thirdParty}/claimUser/{username}": {
"post": {
"description": "Claims the user",
"consumes": [
Expand Down
2 changes: 1 addition & 1 deletion cmd/eskimo-hut/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ paths:
$ref: '#/definitions/server.ErrorResponse'
tags:
- Auth
/v1w/auth/thirdParty/:thirdParty/claimUser/:username:
/v1w/auth/thirdParty/{thirdParty}/claimUser/{username}:
post:
consumes:
- application/json
Expand Down
4 changes: 2 additions & 2 deletions cmd/eskimo-hut/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (s *service) setupAuthRoutes(router *server.Router) {
POST("auth/processFaceRecognitionResult", server.RootHandler(s.ProcessFaceRecognitionResult)).
POST("auth/getValidUserForPhoneNumberMigration", server.RootHandler(s.GetValidUserForPhoneNumberMigration)).
POST("auth/signInWithTelegram", server.RootHandler(s.SignInWithTelegram)).
POST("auth/thirdParty/{thirdParty}/claimUser/{username}", server.RootHandler(s.ClaimUserByThirdParty))
POST("auth/thirdParty/:thirdParty/claimUser/:username", server.RootHandler(s.ClaimUserByThirdParty))
}

// SendSignInLinkToEmail godoc
Expand Down Expand Up @@ -551,7 +551,7 @@ func (s *service) SignInWithTelegram( //nolint:gocritic // .
// @Failure 403 {object} server.ErrorResponse "api key invalid"
// @Failure 500 {object} server.ErrorResponse
// @Failure 504 {object} server.ErrorResponse "if request times out"
// @Router /v1w/auth/thirdParty/:thirdParty/claimUser/:username [POST].
// @Router /v1w/auth/thirdParty/{thirdParty}/claimUser/{username} [POST].
func (s *service) ClaimUserByThirdParty( //nolint:gocritic // .
ctx context.Context,
req *server.Request[ClaimUserByThirdPartyRequestArg, any],
Expand Down
4 changes: 4 additions & 0 deletions cmd/eskimo-hut/eskimo_hut.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func main() {
if cfg.APIKey == "" {
log.Panic("'api-key' is missing")
}
cfg.ThirdPartyAPIKey = strings.ReplaceAll(cfg.ThirdPartyAPIKey, "\n", "")
if cfg.ThirdPartyAPIKey == "" {
log.Panic("'api-key' is missing")
}
nginxPrefix := ""
if cfg.Tenant != "" {
nginxPrefix = "/" + cfg.Tenant
Expand Down

0 comments on commit 238824f

Please sign in to comment.