my-cloud-devops-consulting 1.1.202507090955__py3-none-any.whl → 1.1.202507100004__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 +46 -0
- {my_cloud_devops_consulting-1.1.202507090955.dist-info → my_cloud_devops_consulting-1.1.202507100004.dist-info}/METADATA +1 -1
- my_cloud_devops_consulting-1.1.202507100004.dist-info/RECORD +5 -0
- my_cloud_devops_consulting-1.1.202507090955.dist-info/RECORD +0 -5
- {my_cloud_devops_consulting-1.1.202507090955.dist-info → my_cloud_devops_consulting-1.1.202507100004.dist-info}/WHEEL +0 -0
- {my_cloud_devops_consulting-1.1.202507090955.dist-info → my_cloud_devops_consulting-1.1.202507100004.dist-info}/top_level.txt +0 -0
app.py
CHANGED
@@ -196,6 +196,52 @@ def google_verification():
|
|
196
196
|
def sitemap():
|
197
197
|
return app.send_static_file('sitemap.xml')
|
198
198
|
|
199
|
+
@app.route('/robots.txt')
|
200
|
+
def robots():
|
201
|
+
return app.send_static_file('robots.txt')
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
# adding logic for passwords reset
|
207
|
+
|
208
|
+
from itsdangerous import URLSafeTimedSerializer
|
209
|
+
|
210
|
+
serializer = URLSafeTimedSerializer(SECRET_KEY)
|
211
|
+
|
212
|
+
@app.route('/forgot-password', methods=['GET', 'POST'])
|
213
|
+
def forgot_password():
|
214
|
+
if request.method == 'POST':
|
215
|
+
email = request.form['email']
|
216
|
+
user = users_collection.find_one({'username': email})
|
217
|
+
if user:
|
218
|
+
token = serializer.dumps(str(user['_id']), salt='password-reset')
|
219
|
+
reset_url = url_for('reset_password', token=token, _external=True)
|
220
|
+
send_email("Password Reset Request", email, f"Click here to reset your password: {reset_url}")
|
221
|
+
flash("Password reset link sent to your email.", "info")
|
222
|
+
else:
|
223
|
+
flash("User not found.", "error")
|
224
|
+
return render_template('forgot-password.html')
|
225
|
+
|
226
|
+
|
227
|
+
# adding logic for passwords reset
|
228
|
+
|
229
|
+
@app.route('/reset-password/<token>', methods=['GET', 'POST'])
|
230
|
+
def reset_password(token):
|
231
|
+
try:
|
232
|
+
user_id = serializer.loads(token, salt='password-reset', max_age=3600) # 1 hour
|
233
|
+
except:
|
234
|
+
flash("The reset link is invalid or has expired.", "danger")
|
235
|
+
return redirect(url_for('login'))
|
236
|
+
|
237
|
+
if request.method == 'POST':
|
238
|
+
new_password = request.form['password']
|
239
|
+
hashed = generate_password_hash(new_password)
|
240
|
+
users_collection.update_one({'_id': ObjectId(user_id)}, {'$set': {'password': hashed}})
|
241
|
+
flash("Password updated. Please log in.", "success")
|
242
|
+
return redirect(url_for('login'))
|
243
|
+
|
244
|
+
return render_template('reset-password.html')
|
199
245
|
|
200
246
|
|
201
247
|
if __name__ == '__main__':
|
@@ -0,0 +1,5 @@
|
|
1
|
+
app.py,sha256=Qbame5UH4XuHpIazFJRkF-VxZCNQFLVt7Dfk1osZwrQ,8797
|
2
|
+
my_cloud_devops_consulting-1.1.202507100004.dist-info/METADATA,sha256=dmMjTPnktPN7pPLXqV2vLbd5KlW03h1QbLO-X74Dr28,3329
|
3
|
+
my_cloud_devops_consulting-1.1.202507100004.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
+
my_cloud_devops_consulting-1.1.202507100004.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
|
5
|
+
my_cloud_devops_consulting-1.1.202507100004.dist-info/RECORD,,
|
@@ -1,5 +0,0 @@
|
|
1
|
-
app.py,sha256=1hpC4RMvFogBoNGA8ZWOsbR9qOw3Y3xIHbFhxms61oQ,7165
|
2
|
-
my_cloud_devops_consulting-1.1.202507090955.dist-info/METADATA,sha256=u40u2iOtJViH-ABp8qGVS3WjrRp7Swdlz8m4BEAlkgI,3329
|
3
|
-
my_cloud_devops_consulting-1.1.202507090955.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
-
my_cloud_devops_consulting-1.1.202507090955.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
|
5
|
-
my_cloud_devops_consulting-1.1.202507090955.dist-info/RECORD,,
|
File without changes
|