Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
21eaed3
Prevent logout flow being triggert when incorrect credentials are used
indykoning Oct 20, 2025
28f4af3
Apply fixes from Prettier
indykoning Oct 20, 2025
89d1cb8
Make catch async
indykoning Oct 20, 2025
718a061
Fix error notification message on session expiry
indykoning Oct 20, 2025
1d9758a
Added test
indykoning Nov 18, 2025
690eef4
Merge branch '4.x' of github.com:rapidez/core into bugfix/logout-on-f…
indykoning Nov 18, 2025
e26c288
Apply fixes from Prettier
indykoning Nov 18, 2025
21df82a
Merge branch '4.x' into bugfix/logout-on-failed-login
indykoning Dec 12, 2025
559faaa
[CI] Update Snapshots
indykoning Dec 12, 2025
c87a1fb
Merge branch '4.x' into bugfix/logout-on-failed-login
indykoning Jan 23, 2026
33b7333
[CI] Update Snapshots
indykoning Jan 23, 2026
05eb6d6
Merge branch '4.x' into bugfix/logout-on-failed-login
indykoning Feb 11, 2026
38aa926
Merge branch '4.x' into bugfix/logout-on-failed-login
indykoning Apr 7, 2026
7310944
[CI] Update Snapshots
indykoning Apr 7, 2026
f354eb4
Reset screenshots
indykoning Apr 13, 2026
96d57d2
Merge branch '4.x' of github.com:rapidez/core into bugfix/logout-on-f…
indykoning Apr 13, 2026
e978302
Moved screenshot to class variable
indykoning Apr 13, 2026
caa918c
Reset screenshots
indykoning Apr 13, 2026
1c6e982
Apply fixes from Prettier
indykoning Apr 13, 2026
f73c6a7
Raised phpstan memory limit
indykoning Apr 13, 2026
1f7a53f
Merge branch 'bugfix/logout-on-failed-login' of github.com:rapidez/co…
indykoning Apr 13, 2026
91afbcb
[CI] Update Snapshots
indykoning Apr 13, 2026
2e52b4b
Add wait for network idle before filling email
indykoning Apr 13, 2026
b94c714
Ignore whitespace on text assertion
indykoning Apr 13, 2026
6ff7637
Apply fixes from Prettier
indykoning Apr 13, 2026
ad3b69a
Utilise toContainText
indykoning Apr 13, 2026
2ce7708
Apply fixes from Prettier
indykoning Apr 13, 2026
d180526
[CI] Update Snapshots
indykoning Apr 13, 2026
4e6639d
Fixed memory limit
indykoning Apr 13, 2026
146e201
Merge branch 'bugfix/logout-on-failed-login' of github.com:rapidez/co…
indykoning Apr 13, 2026
d268d3a
Reset phpstan memory limit
indykoning Apr 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion resources/js/components/Checkout/CheckoutLogin.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script>
import { SessionExpired } from '../../fetch'
import { cart, setGuestEmailOnCart } from '../../stores/useCart'
import { isEmailAvailable, login, register, user } from '../../stores/useUser'
import { useDebounceFn } from '@vueuse/core'
Expand Down Expand Up @@ -70,7 +71,15 @@ export default {
async handleLogin() {
return await login(this.email, this.password)
.then(() => true)
.catch((error) => {
.catch(async (error) => {
if (error instanceof SessionExpired) {
let data = await error.response.json()
if (data?.errors?.[0]?.message) {
Notify(data.errors[0].message, 'error')
return false
}
}

if (error.message) {
Notify(error.message, 'error')
}
Expand Down
1 change: 1 addition & 0 deletions resources/js/stores/useUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export const login = async function (email, password) {
},
{
notifyOnError: false,
redirectOnExpiration: false,
},
).then(async (response) => {
await loginByToken(response.data.generateCustomerToken.token)
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/notifications.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<notifications v-cloak>
<div class="fixed sm:max-w-sm sm:w-full top-6 right-6 left-6 sm:left-auto flex flex-col z-notifications" slot-scope="{ notifications }">
<div class="fixed sm:max-w-sm sm:w-full top-6 right-6 left-6 sm:left-auto flex flex-col z-notifications" data-testid="notifications" slot-scope="{ notifications }">
<notification v-if="notifications.length" v-for="(notification, index) in notifications" :notification="notification" :key="index +1">
<transition
enter-active-class="ease-in-out duration-500"
Expand Down
28 changes: 28 additions & 0 deletions tests/playwright/checkout.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,31 @@ checkoutTypes.forEach((type) => {
await checkoutPage.checkout(email, password)
})
})

test('incorrect password login', BasePage.tags, async ({ page }) => {
const productPage = new ProductPage(page)
const checkoutPage = new CheckoutPage(page, 'default')
const accountPage = new AccountPage(page)

const email = `wayne+${crypto.randomUUID()}@enterprises.com`
const password = 'IronManSucks.91939'

// Register
await productPage.addToCart(process.env.PRODUCT_URL_SIMPLE)
await checkoutPage.checkout(email, password, true, ['credentials'])

await accountPage.logout()

// Login
await productPage.addToCart(process.env.PRODUCT_URL_SIMPLE)
await checkoutPage.gotoCheckout()
await checkoutPage.login(email, password + '!')
await this.page.getByTestId('continue').click()
await this.page.waitForTimeout(500)
await this.page.waitForLoadState('networkidle')
await expect(page.getByTestId('notifications')).toHaveText(
'The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we change this weird Magento message in the past?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default Magento message, it can be changed via magento translations but we do not do that in the magento sample data container

)

await checkoutPage.checkout(email, password)
})
Loading