# G4 Link states

[Index](../index.md) | [Tree](../tree.md) | HTML version: [G4.html](G4.html)

Every state of the confirmation link page: random, malformed and expired tokens (invalid), used token, signed in as a different account (with recovery), changed account email, and nothing left to add. Expired, used, wrong-customer, email-changed and nothing-left are reached by inserting or editing DB rows.

<a id="a15"></a>
## A15 Random 64-hex token

*Language: EN | Mode: login | Status: PASS | Repo spec: GOL S4*

logged-out visitor opens a random 64-hex token: data-state=invalid, text "This link is invalid or has expired...", clean URL order_link/confirm without token; the "My Account" link in the text leads to the login page (token generated in the script, no DB rows)

![01. invalid link](../media/G4/A15-01-invalid-link.png)
*01. invalid link*

![02. my account link leads to login](../media/G4/A15-02-my-account-link-leads-to-login.png)
*02. my account link leads to login*

Video: [A15-random-token](../media/G4/A15-random-token.webm)

<a id="a16"></a>
## A16 Malformed token `abc`

*Language: EN | Mode: login | Status: PASS | Repo spec: GOL S4*

logged-out visitor opens token "abc" (not 64 hex): same invalid text and clean URL as A15

![01. invalid link malformed token](../media/G4/A16-01-invalid-link-malformed-token.png)
*01. invalid link malformed token*

Video: [A16-malformed-token](../media/G4/A16-malformed-token.webm)

<a id="a17"></a>
## A17 Expired token

*Language: EN | Mode: login | Status: PASS | Repo spec: GOL S4*

expired state reached by DB manipulation (link row inserted with date_expires 60 s in the past): invalid text, clean URL; the guest order stays unlinked (customer_id 0), link not marked used

![01. expired link invalid](../media/G4/A17-01-expired-link-invalid.png)
*01. expired link invalid*

Video: [A17-expired-token](../media/G4/A17-expired-token.webm)

<a id="a18"></a>
## A18 Used token

*Language: EN | Mode: login | Status: PASS | Repo spec: GOL S4 (+S1 reopen)*

used state reached by DB manipulation (link row inserted with date_used set): data-state=used, text "This link has already been used...", clean URL; nothing linked. The genuine used-after-confirm case is in G1/A01

![01. already used link](../media/G4/A18-01-already-used-link.png)
*01. already used link*

Video: [A18-used-token](../media/G4/A18-used-token.webm)

<a id="a19"></a>
## A19 Signed in as a different account, then recovery

*Language: EN | Mode: login | Status: PASS | Repo spec: GOL S5*

signed in as B opens A's link (link row inserted via DB): wrong_customer text; then logout, login as A, open the confirm route (token kept in session), password, success "Orders added to your account: 1"

![01. wrong customer logged in as b](../media/G4/A19-01-wrong-customer-logged-in-as-b.png)
*01. wrong customer logged in as b*

![02. password step for a](../media/G4/A19-02-password-step-for-a.png)
*02. password step for a*

![03. success one order](../media/G4/A19-03-success-one-order.png)
*03. success one order*

Video: [A19-wrong-customer](../media/G4/A19-wrong-customer.webm)

<a id="a20"></a>
## A20 Account email changed after the link was sent

*Language: EN | Mode: login | Status: PASS | Repo spec: GOL S6*

email change reached by DB manipulation (UPDATE oc_customer email after the link row was inserted); logged in with the new address: email_changed text; order stays unlinked, link unused

![01. email changed notice](../media/G4/A20-01-email-changed-notice.png)
*01. email changed notice*

Video: [A20-email-changed](../media/G4/A20-email-changed.webm)

<a id="a21"></a>
## A21 Nothing left to add

*Language: EN | Mode: login | Status: PASS | Repo spec: none*

reached by DB manipulation (fake order's customer_id set to the customer after the link row was inserted): password step, then data-state=none "Your email address is confirmed. There was nothing left to add..."

![01. password step](../media/G4/A21-01-password-step.png)
*01. password step*

![02. nothing left to add](../media/G4/A21-02-nothing-left-to-add.png)
*02. nothing left to add*

Video: [A21-nothing-left](../media/G4/A21-nothing-left.webm)
