|
1 | 1 | from datetime import datetime, timedelta
|
2 | 2 |
|
3 |
| -from flask import redirect, request, url_for, flash, render_template, Blueprint, session |
| 3 | +from flask import redirect, request, url_for, flash, render_template, Blueprint, session, current_app as app |
4 | 4 |
|
5 | 5 | from .ds_client import DSClient
|
6 | 6 | from .utils import ds_logout_internal
|
|
14 | 14 | def ds_login():
|
15 | 15 | if not session.get("auth_type"):
|
16 | 16 | session["auth_type"] = request.form.get("auth_type")
|
| 17 | + app.config["isLoggedIn"] = True |
| 18 | + app.config["quickstart"] = DS_CONFIG["quickstart"] |
17 | 19 | return DSClient.login(session["auth_type"])
|
18 | 20 |
|
19 | 21 |
|
20 | 22 | @ds.route("/logout")
|
21 | 23 | def ds_logout():
|
22 | 24 | ds_logout_internal()
|
23 | 25 | flash("You have logged out from DocuSign.")
|
| 26 | + app.config["isLoggedIn"] = False |
| 27 | + app.config["quickstart"] = False |
24 | 28 | return redirect(url_for("core.index"))
|
25 | 29 |
|
26 | 30 |
|
@@ -52,12 +56,12 @@ def ds_callback():
|
52 | 56 | if target_account_id:
|
53 | 57 | account = next((a for a in accounts if a["account_id"] == target_account_id), None)
|
54 | 58 | if not account:
|
55 |
| - # Panic! The user does not have the targeted account. They should not log in! |
| 59 | + # The user does not have the targeted account. They should not log in! |
56 | 60 | raise Exception("No access to target account")
|
57 | 61 | else: # get the default account
|
58 | 62 | account = next((a for a in accounts if a["is_default"]), None)
|
59 | 63 | if not account:
|
60 |
| - # Panic! Every user should always have a default account |
| 64 | + # Every user should always have a default account |
61 | 65 | raise Exception("No default account")
|
62 | 66 |
|
63 | 67 | # Save the account information
|
|
0 commit comments