From a9544c19a1d3a38f76c0a2beaad32c3001de5fa3 Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 10 Oct 2019 01:30:33 -0700 Subject: [PATCH 1/3] Tidying up errors Error message tidying up. Hopefully the footer works too. --- app.py | 8 ++++---- app_settings.py | 5 +++-- templates/about.html | 10 +++++++++- templates/deny.html | 1 - templates/include/footer.html | 5 ++++- templates/launch.html | 4 ++-- templates/tos.html | 2 +- 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/app.py b/app.py index c20a355..f67708e 100644 --- a/app.py +++ b/app.py @@ -37,7 +37,7 @@ else: def index(): #This is the root index. If not logged in it displays homepage.html if not google_auth.is_logged_in(): - return flask.render_template('homepage.html', denymsg = loginMsg, loggedin = False) + return flask.render_template('homepage.html', loggedin = False) user_info = google_auth.get_user_info() indbRes = appdb.isUserinDB(user_info['id']) @@ -46,11 +46,11 @@ def index(): pprint.pprint(indbRes) refreshtoken = google_auth.getRefreshToken() if not refreshtoken: - return "Error with your refresh token" + return flask.render_template('error.html', denymsg = 'Error with your refresh token.', loggedin = False) userid = appdb.getUserIDfromGoogleID(user_info['id']) if not userid: - return 'You are not currently logged in.' + return flask.render_template('error.html', denymsg = 'You are not currently logged in.', loggedin = False) rows = appdb.getDIDsbyAccount(userid) return flask.render_template('index.html', @@ -64,7 +64,7 @@ def index(): if user_info['verified_email'] == True: verifiedVar = True appdb.setNewUser(user_info['id'], refreshtoken, user_info['name'], user_info['email'], verifiedVar) - return flask.redirect(uri, code=302) + return flask.redirect('https://thewords.faith/', code=302) else: #This means they aren't verified. verifiedVar = False diff --git a/app_settings.py b/app_settings.py index 9b0fa2b..7ce6e25 100644 --- a/app_settings.py +++ b/app_settings.py @@ -23,11 +23,12 @@ else: @app.route('/settings') def appsettings(): if not google_auth.is_logged_in(): - return flask.render_template('deny.html', denymsg = 'You are not authorized to be here', loggedin = False) + return flask.render_template('deny.html', denymsg = "I don't know who you are so I can't help you with your settings. :(", loggedin = False) user_info = google_auth.get_user_info() refreshtoken = google_auth.getRefreshToken() + if not refreshtoken: - return flask.render_template('error.html', denymsg = 'Error with your refresh token', loggedin = False) + return flask.render_template('error.html', denymsg = 'Error with your refresh token.', loggedin = False) userid = appdb.getUserIDfromGoogleID(user_info['id']) if not userid: return flask.render_template('error.html', denymsg = 'You are not currently logged in.', loggedin = False) diff --git a/templates/about.html b/templates/about.html index e8340a8..5e28b72 100644 --- a/templates/about.html +++ b/templates/about.html @@ -8,8 +8,16 @@

About TheWords!

-
+

We're all about getting thewords out and allowing us to communicate securely to friends and loved ones.

+

This site is still under active development and subject to change. For those who are interested in helping + with development or testing hit me up on my GitHub sms-proj Page.

+
+ {% include 'include/footer.html' %} diff --git a/templates/deny.html b/templates/deny.html index f3521f6..2c8ca80 100644 --- a/templates/deny.html +++ b/templates/deny.html @@ -9,5 +9,4 @@

503 Denied.

{{ denymsg }}

-

Please login at The Login Page

{% include 'include/footer.html' %} diff --git a/templates/include/footer.html b/templates/include/footer.html index 5e12d8e..d31cfce 100644 --- a/templates/include/footer.html +++ b/templates/include/footer.html @@ -1,3 +1,6 @@ +{% if loggedin == False %} +

Please login at The Login Page

+{% endif %} -
+

Thewords.faith Terms of Service

This site is not to be used for 'for profit' ventures such as spam, robo texting, robo dialing, or any form of harassment or illegal contact.

From ab07c7acc52da3c1c3947ca4059746e98e4868fc Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 10 Oct 2019 01:30:33 -0700 Subject: [PATCH 2/3] Tidying up errors Error message tidying up. Hopefully the footer works too. --- app.py | 8 ++++---- app_settings.py | 5 +++-- templates/about.html | 10 +++++++++- templates/deny.html | 1 - templates/homepage.html | 4 ++-- templates/include/footer.html | 5 ++++- templates/launch.html | 4 ++-- templates/tos.html | 2 +- 8 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app.py b/app.py index c20a355..f67708e 100644 --- a/app.py +++ b/app.py @@ -37,7 +37,7 @@ else: def index(): #This is the root index. If not logged in it displays homepage.html if not google_auth.is_logged_in(): - return flask.render_template('homepage.html', denymsg = loginMsg, loggedin = False) + return flask.render_template('homepage.html', loggedin = False) user_info = google_auth.get_user_info() indbRes = appdb.isUserinDB(user_info['id']) @@ -46,11 +46,11 @@ def index(): pprint.pprint(indbRes) refreshtoken = google_auth.getRefreshToken() if not refreshtoken: - return "Error with your refresh token" + return flask.render_template('error.html', denymsg = 'Error with your refresh token.', loggedin = False) userid = appdb.getUserIDfromGoogleID(user_info['id']) if not userid: - return 'You are not currently logged in.' + return flask.render_template('error.html', denymsg = 'You are not currently logged in.', loggedin = False) rows = appdb.getDIDsbyAccount(userid) return flask.render_template('index.html', @@ -64,7 +64,7 @@ def index(): if user_info['verified_email'] == True: verifiedVar = True appdb.setNewUser(user_info['id'], refreshtoken, user_info['name'], user_info['email'], verifiedVar) - return flask.redirect(uri, code=302) + return flask.redirect('https://thewords.faith/', code=302) else: #This means they aren't verified. verifiedVar = False diff --git a/app_settings.py b/app_settings.py index 9b0fa2b..7ce6e25 100644 --- a/app_settings.py +++ b/app_settings.py @@ -23,11 +23,12 @@ else: @app.route('/settings') def appsettings(): if not google_auth.is_logged_in(): - return flask.render_template('deny.html', denymsg = 'You are not authorized to be here', loggedin = False) + return flask.render_template('deny.html', denymsg = "I don't know who you are so I can't help you with your settings. :(", loggedin = False) user_info = google_auth.get_user_info() refreshtoken = google_auth.getRefreshToken() + if not refreshtoken: - return flask.render_template('error.html', denymsg = 'Error with your refresh token', loggedin = False) + return flask.render_template('error.html', denymsg = 'Error with your refresh token.', loggedin = False) userid = appdb.getUserIDfromGoogleID(user_info['id']) if not userid: return flask.render_template('error.html', denymsg = 'You are not currently logged in.', loggedin = False) diff --git a/templates/about.html b/templates/about.html index e8340a8..5e28b72 100644 --- a/templates/about.html +++ b/templates/about.html @@ -8,8 +8,16 @@

About TheWords!

-
+

We're all about getting thewords out and allowing us to communicate securely to friends and loved ones.

+

This site is still under active development and subject to change. For those who are interested in helping + with development or testing hit me up on my GitHub sms-proj Page.

+
+ {% include 'include/footer.html' %} diff --git a/templates/deny.html b/templates/deny.html index f3521f6..2c8ca80 100644 --- a/templates/deny.html +++ b/templates/deny.html @@ -9,5 +9,4 @@

503 Denied.

{{ denymsg }}

-

Please login at The Login Page

{% include 'include/footer.html' %} diff --git a/templates/homepage.html b/templates/homepage.html index bec0e70..946963f 100644 --- a/templates/homepage.html +++ b/templates/homepage.html @@ -14,8 +14,8 @@ $("document").ready(function() {

Right now we are not even in beta, and the service isn't ready for the world yet. At least until we get some more testers.

This site, in the end, will allow users to send text messages to the US for a low monthly fee. - This allows businesses or end users who want privacy or a business sms number - to do just that, send and receive messages.

+ This allows businesses or end users who want privacy minded or a business sms number that + allows you to stay in touch with your customers by providing SMS and eventually MMS support.