fix(minor): only show authorization message if connected app is set (#19605)
This commit is contained in:
parent
50327203ce
commit
1e6086fd75
2 changed files with 2 additions and 2 deletions
|
|
@ -166,7 +166,7 @@ frappe.ui.form.on("Email Account", {
|
|||
},
|
||||
|
||||
show_oauth_authorization_message(frm) {
|
||||
if (frm.doc.auth_method === "OAuth") {
|
||||
if (frm.doc.auth_method === "OAuth" && frm.doc.connected_app) {
|
||||
frappe.call({
|
||||
method: "frappe.integrations.doctype.connected_app.connected_app.has_token",
|
||||
args: {
|
||||
|
|
|
|||
|
|
@ -167,4 +167,4 @@ def callback(code=None, state=None):
|
|||
def has_token(connected_app, connected_user=None):
|
||||
app = frappe.get_doc("Connected App", connected_app)
|
||||
token_cache = app.get_token_cache(connected_user or frappe.session.user)
|
||||
return bool(token_cache.get_password("access_token", False))
|
||||
return bool(token_cache and token_cache.get_password("access_token", False))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue