magento / pwa-studio

🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.
https://developer.adobe.com/commerce/pwa-studio/
Open Software License 3.0
1.06k stars 683 forks source link

PWA-3236: Change user time to logout #4260

Closed glo11372 closed 1 month ago

glo11372 commented 3 months ago

Description

1.Inside admin panel set any value of Cookie Lifetime (stores->configuration->general->web->DefaultCookies setting>Cookie Lifetime)

  1. Go to your Venia store login with your credentials and wait &check you will be logout as per the cookies lifetime value

Related Issue

Closes #4230

Acceptance

Verification Stakeholders

Specification

Verification Steps

Test scenario(s) for direct fix/feature

1.Try to change admin panel cookies lifetime value and test on frontend 2.If the value is empty it will by default use 3600

Test scenario(s) for any existing impacted features/areas

Test scenario(s) for any Magento Backend Supported Configurations

Is Browser/Device testing needed?

Any ad-hoc/edge case scenarios that need to be considered?

Screenshots / Screen Captures (if appropriate)

Breaking Changes (if any)

Checklist

pwa-studio-bot commented 3 months ago
Fails
:no_entry_sign: `node` failed.
:no_entry_sign: GraphQL queries did not pass. Make sure to execute `yarn run validate-queries` locally prior to committing.
Messages
:book: DangerCI Failures related to missing labels/description/linked issues/etc will persist until the next push or next pr-test build run (assuming they are fixed).
:book: Access a deployed version of this PR [here](https://pr-4260.pwa-venia.com/). Make sure to wait for the "pwa-pull-request-deploy" job to complete.

Log

ERROR ON TASK: validateQueries


Error:  Danger had errors running. See message(s) above for more details.
danger-results://tmp/danger-results.json

Generated by :no_entry_sign: dangerJS against facd23dc97ef3f9087d8b5d92e5a76a2b7c08e47

huykon commented 2 months ago

Hi @glo11372 the mutation generateCustomerToken didn't return cookie_lifetime so far, why we don't use Customer Token Lifetime in (stores->configuration->services->OAuth->Access Token Expiration>Customer Token Lifetime (hours) ) ?

glo11372 commented 2 months ago

Hi @glo11372 the mutation generateCustomerToken didn't return cookie_lifetime so far, why we don't use Customer Token Lifetime in (stores->configuration->services->OAuth->Access Token Expiration>Customer Token Lifetime (hours) ) ?

Hi @huykon

  1. Yes you are right we can use ‘Customer Token Lifetime’ here and convert that hour in seconds and pass it to PWA.
  2. Added optional value (Customer Token Lifetime’) in generateCustomerToken which can be used in pwa