Skip to content

Commit e613a01

Browse files
committed
Updating endpoints to use URL variable instead of hard coded.
1 parent 7a7846f commit e613a01

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

api/.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ COGNITO_REDIRECT_URI=http://localhost:4040/signin
55
COGNITO_USER_POOL_ID=
66
SECRET_KEY=
77
COGNITO_ACCESS_ID=
8-
COGNITO_ACCESS_KEY=
8+
COGNITO_ACCESS_KEY=
9+
URL=http://localhost:4040

api/openapi_server/controllers/auth_controller.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
COGNITO_ACCESS_ID = env.get('COGNITO_ACCESS_ID')
3030
COGNITO_ACCESS_KEY = env.get('COGNITO_ACCESS_KEY')
3131
SECRET_KEY=env.get('SECRET_KEY')
32+
URL=env.get('URL')
3233
cognito_client_url = 'https://homeuniteus.auth.us-east-1.amazoncognito.com'
3334

3435

@@ -154,7 +155,7 @@ def signin():
154155
if(response.get('ChallengeName') and response['ChallengeName'] == 'NEW_PASSWORD_REQUIRED'):
155156
userId = response['ChallengeParameters']['USER_ID_FOR_SRP']
156157
sessionId = response['Session']
157-
return redirect(f"http://localhost:4040/create-password?userId={userId}&sessionId={sessionId}")
158+
return redirect(f"{URL}/create-password?userId={userId}&sessionId={sessionId}")
158159

159160
access_token = response['AuthenticationResult']['AccessToken']
160161
refresh_token = response['AuthenticationResult']['RefreshToken']
@@ -423,9 +424,9 @@ def confirm_signup():
423424
ConfirmationCode=code
424425
)
425426

426-
return redirect("http://localhost:4040/email-verification-success")
427+
return redirect("{URL}/email-verification-success")
427428
except Exception as e:
428-
return redirect("http://localhost:4040/email-verification-error")
429+
return redirect("{URL}/email-verification-error")
429430

430431
# What comes first invite or adding the user
431432
#Do I have an oauth token

0 commit comments

Comments
 (0)