Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This 'confirm form resubmission' is from your web browser, not from Tank Auth. Some time ago someone coding a web browser realised that reposting is a big problem so they put in a warning to stop ppl double-posting and such.</p> <p>I can think of 2 ways to avoid it.</p> <p>1) Make the login 'post' into a 'get'. This is a BAD idea. cos your password is in the query string</p> <p>2) In the auth controller redirect to an error display version of the login form on login fail instead of loading the login form view again.</p> <p>basically you find a way to pass the error message to your login form via query string or session. the redirect to that page. Its pretty easy since tank auth uses language keys for errors.</p> <p>I just tried it as a query string.. seems to work ok, but my tank auth is pretty heavily modified.</p> <p>I added this to <code>controllers/auth.php</code> right after the part where it says <code>//fail</code></p> <pre><code>redirect('auth/login/'.$errors['login']); </code></pre> <p>this takes the login error key generated by tank auth and passes it back to <code>http://yoursite/auth/login</code> as a query parameter.</p> <p>then at the top of the login function I put this:</p> <pre><code>function login($error = ''){ if ($error != '') { $data['errors']['login'] = $this-&gt;lang-&gt;line($error); $this-&gt;load-&gt;view('auth/login_form', $data); } </code></pre> <p>this code grabs the parameter if its there.. then grabs the appropriate line from your language file, then loads the login form.</p> <p>note this will only handle 'login' errors. you will need to pass more query parameters to handle things like validation errors.</p> <p>// edit I thought I'd try the session way.. and its much neater.</p> <p>this goes at the <code>//fail</code> spot</p> <pre><code>$this-&gt;session-&gt;set_flashdata('login_error', $this-&gt;lang-&gt;line($errors['login'])); redirect('/auth/login'); </code></pre> <p>and something like this goes in views/auth/login_form.php instead of where the form_errors are.</p> <pre><code>&lt;? if ( $this-&gt;session-&gt;flashdata('login_error') != '') { echo '&lt;p style="color:#f00;"&gt;'.$this-&gt;session-&gt;flashdata('login_error').'&lt;/p&gt;'; } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload