Skip to content

Commit

Permalink
quote the password in the userscript
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiet480 committed Apr 17, 2017
1 parent 7aad057 commit 59172e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion HomeAssistant/Views/WebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class WebViewController: UIViewController, WKNavigationDelegate {
override func loadView() {
let config = WKWebViewConfiguration()
if let apiPass = keychain["apiPassword"] {
let scriptStr = "window.hassConnection = createHassConnection(\(apiPass));"
let scriptStr = "window.hassConnection = createHassConnection(\"\(apiPass)\");"
let script = WKUserScript(source: scriptStr, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
let userContentController = WKUserContentController()
userContentController.addUserScript(script)
Expand Down

0 comments on commit 59172e2

Please sign in to comment.