Secure login not working

Hi, I tried working through the documentation and made a test page to try out the secure log in. Everything looks OK but when I enter the correct username and password it does not jump to the success page I have defined, and when incorrect info is typed it does not display the alert message.

Some photos and the code below - I’m I doing something wrong or is this an issue on the MAC side?

PS. the test link (big Wappler logo) works fine and jumps to the success page fine…

<!doctype html>
<html><head>
<meta charset="UTF-8">
<title>Untitled Document</title>
  <script type="text/javascript" src="dmxAppConnect/dmxAppConnect.js"></script>
  <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
  <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
  <script type="text/javascript" src="dmxAppConnect/dmxBrowser/dmxBrowser.js"></script>
  </head>
  <body is="dmx-app">
    <div is="dmx-browser" id="browser1"></div>
    <div class="container">
      <div class="container">
        <div class="row">
          <div class="col">
            <div class="container">
              <form method="post" is="dmx-serverconnect-form" id="serverconnectform1" action="dmxConnect/api/Security/login.php" dmx-on:success="browser1.goto('TestForm.php')" dmx-on:unauthorized="browser1.alert('Wrong login details!')">
                <div class="row">
                  <div class="col-12 col-md-8 col-lg-7 col-xl-5 text-left">
                    <div class="row">
                      <div class="col">
                        <h1>Log In</h1>
                        <p class="text-h3">Enter your details below.</p>
                      </div>
                    </div>
                    <div class="row">
                      <div class="col mt-4">
                        <input type="text" class="form-control" placeholder="Your username" name="username" id="username">
                      </div>
                    </div>
                    <div class="row mt-4">
                      <div class="col">
                        <input type="password" class="form-control mb-2" placeholder="Your password" id="password" name="password">
                        <div class="form-check">
                          <input class="form-check-input" type="checkbox" value="1" id="remember" name="remember">
                          <label class="form-check-label" for="input1">Keep me logged in</label>
                        </div>
                      </div>
                    </div>
                    <div class="row mt-4">
                      <div class="col">
                        <button class="btn bg-light" type="submit">Submit</button>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="d-flex"><a href="TestForm.php"><img src="img/f7-icon.png"></a>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
    <script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
  </body></html>

It’s hard to tell what is wrong, until we see the live page. Please send the link and login details as a private message, so i can check this.

I sent it to you… thx

There’s a server error 500 returned by your server action. Please check this, to see how to debug and check the exact error returned: Debugging Problems

So the only info I can find is below - but I really don’t know what I’m doing…

[Error] Failed to load resource: the server responded with a status of 500 (Internal Server Error) (login.php, line 0)

Summary
URL: http://www.mypizzamaster.com/dmxConnect/api/Security/login.php
Status: 500 Internal Server Error
Source: Network
Address: 107.180.40.116:80

Request
POST /dmxConnect/api/Security/login.php HTTP/1.1
Cookie: _tccl_visit=2031c9c3-6562-4b25-a522-02e0e27e0eab; _tccl_visitor=1ff509dc-9676-44d0-b1fe-018cf30c6600; PHPSESSID=4fd9557466d45af5d8763d12c566b1dc; numberdoughballs=1
Accept: /
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryJLixZYAS92W79eqB
Origin: http://www.mypizzamaster.com
Content-Length: 241
Accept-Language: en-us
Host: www.mypizzamaster.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15
Referer: http://www.mypizzamaster.com/loginpage.html
Accept-Encoding: gzip, deflate
Connection: keep-alive

Response
HTTP/1.1 500 Internal Server Error
Vary: Accept-Encoding,User-Agent
Content-Type: text/html; charset=UTF-8
Pragma: no-cache
Cache-Control: no-store, no-cache, must-revalidate
Date: Sun, 21 Oct 2018 15:11:46 GMT
Content-Encoding: gzip
Content-Length: 72
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Connection: close
X-Powered-By: PHP/7.2.6
Server: Apache

Request Data
MIME Type: multipart/form-data
Boundary: ----WebKitFormBoundaryJLixZYAS92W79eqB
Request Data:

Please do what is described in the tutorial i sent you. Especially the part explaining how to enable the debug mode.

go, to the server connect panel, click the cog for server connect settings and activate debug mode

That was the first thing I did - I just re-saved and got the same message (second jpeg)

2018-10-21_08-34-02

2018-10-21_08-35-41

Make sure remote target is selected or manually upload the site there.

OK, picked the live site as target and re-saved - seems to be working better now

{
    "code": 0,
    "file": "/home/lyrqf0b8ruj0/public_html/dmxConnectLib/dmxConnect.php",
    "line": 115,
    "message": "Option \"permissions\" is required!",
    "trace": "#0 /home/lyrqf0b8ruj0/public_html/dmxConnectLib/lib/auth/StaticProvider.php(14): option_require(Object(stdClass), 'permissions')\n#1 /home/lyrqf0b8ruj0/public_html/dmxConnectLib/lib/auth/Provider.php(53): lib\\auth\\StaticProvider->__construct(Object(lib\\App), Object(stdClass))\n#2 /home/lyrqf0b8ruj0/public_html/dmxConnectLib/modules/auth.php(11): lib\\auth\\Provider->__construct(Object(lib\\App), Object(stdClass), 'security1')\n#3 /home/lyrqf0b8ruj0/public_html/dmxConnectLib/lib/App.php(159): modules\\auth->provider(Object(stdClass), 'security1')\n#4 /home/lyrqf0b8ruj0/public_html/dmxConnectLib/lib/App.php(128): lib\\App->execSteps(Object(stdClass))\n#5 /home/lyrqf0b8ruj0/public_html/dmxConnectLib/lib/App.php(98): lib\\App->execSteps(Array)\n#6 /home/lyrqf0b8ruj0/public_html/dmxConnectLib/lib/App.php(71): lib\\App->exec(Object(stdClass))\n#7 /home/lyrqf0b8ruj0/public_html/dmxConnect/api/Security/login.php(8): lib\\App->define(Object(stdClass))\n#8 {main}"
}

This bug is only related to “static” security provider and will be fixed in the next update.

Is it possible to use a database provider and test again?

Sure I can try but that is much harder - I’m not having much luck with my SQL stuff - I’ll try - thanks for letting me know it is a bug - gives me hope I can somehow get all this working eventually :slight_smile:

Wow, I switched it over to database, inserted a test user and PW via PHPmyAdmin, re-saved everything, re-published everything and much to my surprise it is working perfect. Amazing since I have never done any SQL stuff before - a big thank you to the community here!!!

:grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning::grinning:

2 Likes

That’s what you should expect from Wappler :slight_smile:
You should not need any SQL skills to work with databases.

1 Like