my-cloud-devops-consulting 1.1.202507211526__py3-none-any.whl → 1.1.202507211609__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
app.py CHANGED
@@ -7,11 +7,14 @@ import os
7
7
  from flask_login import LoginManager,login_user,UserMixin,login_required,logout_user,current_user
8
8
  from settings import SECRET_KEY,MONGO_URI, EMAIL_USER, MONGO_PASSWORD, MONGO_USERNAME
9
9
  from utils import send_email, get_videos
10
+ from werkzeug.middleware.proxy_fix import ProxyFix
10
11
 
11
12
 
12
13
 
13
14
  app = Flask(__name__)
14
15
  app.secret_key = SECRET_KEY # Secure your secret key with an environment variable
16
+ # 🔐 Let Flask correctly detect HTTPS and domain from proxy headers
17
+ app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1)
15
18
  ### app.secret_key = SECRET_KEY isn’t an import at all—it’s just an assignment
16
19
  login_manager = LoginManager()
17
20
 
@@ -128,14 +131,22 @@ def contact_form():
128
131
  return redirect(url_for('contact_form'))
129
132
  return render_template('contact-form.html')
130
133
 
134
+ # Update the /videos route to support both login types if does not work use this old one
135
+ # @app.route('/videos')
136
+ # # @login_required
137
+ # def private_videos():
138
+ # if not current_user.is_authenticated:
139
+ # return redirect(url_for('login'))
140
+ # videos = get_videos()
141
+ # return render_template('private-videos.html', videos=videos)
131
142
 
132
143
  @app.route('/videos')
133
- # @login_required
134
144
  def private_videos():
135
- if not current_user.is_authenticated:
145
+ if not current_user.is_authenticated and 'user' not in session:
136
146
  return redirect(url_for('login'))
137
147
  videos = get_videos()
138
148
  return render_template('private-videos.html', videos=videos)
149
+
139
150
  @app.route("/logout")
140
151
  @login_required
141
152
  def logout():
@@ -278,14 +289,16 @@ oauth.register(
278
289
  def login_cognito():
279
290
  session.pop('user', None)
280
291
  redirect_uri = url_for('authorize', _external=True)
292
+ print("🧭 Redirect URI being used:", redirect_uri) # <--- add this
281
293
  return oauth.oidc.authorize_redirect(
282
294
  redirect_uri,
283
- prompt='login' # 🔄 Forces re-authentication from Cognito
295
+ prompt='login'
284
296
  )
285
297
 
286
298
 
287
299
 
288
300
 
301
+
289
302
  # The OAuth module collects the access token and retrieves user data from the Amazon Cognito userInfo endpoint. Configure an authorize route to handle the access token and user data after authentication.
290
303
  @app.route('/authorize')
291
304
  def authorize():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: my-cloud-devops-consulting
3
- Version: 1.1.202507211526
3
+ Version: 1.1.202507211609
4
4
  Summary: This is my consulting website for Cloud & DevOps services.
5
5
  Home-page: https://github.com/Betrand1999/project-root
6
6
  Author: Betrand Mutagha
@@ -0,0 +1,5 @@
1
+ app.py,sha256=STrknza7ZbJMynowuRGtvxcHrLWZLC3fzLcQUyvGb2g,11234
2
+ my_cloud_devops_consulting-1.1.202507211609.dist-info/METADATA,sha256=Y4jYh3nCeLIZwdkTrIApzkfwZQl01R1Im7kypFe_rcM,785
3
+ my_cloud_devops_consulting-1.1.202507211609.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4
+ my_cloud_devops_consulting-1.1.202507211609.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
5
+ my_cloud_devops_consulting-1.1.202507211609.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- app.py,sha256=kf-nKabfd4hJPYQv2sijm56CXGwKtgoHHAsL47G3j68,10675
2
- my_cloud_devops_consulting-1.1.202507211526.dist-info/METADATA,sha256=3l06My-ei-01_CZMJVCX_0a7sUaRKZ4zV7E7NnZ5kIQ,785
3
- my_cloud_devops_consulting-1.1.202507211526.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4
- my_cloud_devops_consulting-1.1.202507211526.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
5
- my_cloud_devops_consulting-1.1.202507211526.dist-info/RECORD,,