Fakultas Ilmu Komputer UI

Commit bbff4370 authored by Wulan Mantiri's avatar Wulan Mantiri
Browse files

Merge branch 'fix-login-bug' into 'staging'

[REFACTOR] Fix login bug by handling expired or non-existing cart for user

See merge request !79
parents 3d046098 5f8fdee2
Pipeline #83001 passed with stages
in 44 minutes
...@@ -15,6 +15,12 @@ export const getNavigation = ( ...@@ -15,6 +15,12 @@ export const getNavigation = (
) => { ) => {
if (isAuthenticated) { if (isAuthenticated) {
if (user.role === UserRole.CLIENT) { if (user.role === UserRole.CLIENT) {
if (!user.cart_id) {
return {
initialRoute: ROUTES.allAccessQuestionnaire,
navigation: unpaidClientNavigation,
};
}
if ([TransactionStatus.UNPAID, null].includes(user.transaction_status)) { if ([TransactionStatus.UNPAID, null].includes(user.transaction_status)) {
return { return {
initialRoute: ROUTES.checkout, initialRoute: ROUTES.checkout,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment