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 682 forks source link

[feature]: Change user time to logout #4230

Closed sm1thana closed 2 months ago

sm1thana commented 7 months ago

Is your feature request related to a problem? Please describe. The user becomes unauthorized after 1 hour. I'd like to change this time.

Describe the solution you'd like @magento/peregrine/lib/store/actions/user/asyncActions.js has a setToken function that sets ttl time to 3600.

export const setToken = token =>
    async function thunk(...args) {
        const [dispatch] = args;

        // Store token in local storage.
        // TODO: Get correct token expire time from API
        storage.setItem('signin_token', token, 3600);

        // Persist in store
        dispatch(actions.setToken(token));
    };

I'd like to change this time, but I can't extend this file or function. I read this manual, but didn't find any helpful information https://developer.adobe.com/commerce/pwa-studio/guides/general-concepts/extensibility/

I thought I could extend this file like a talon:

const peregrineTargets = targets.of('@magento/peregrine');
const talonsTarget = peregrineTargets.talons;

and get a store param from peregrineTargets, but it has only talons and hooks fields.

So, could you be so kind to help me, to change this param?

Please let us know what packages this feature is in regards to:

m2-assistant[bot] commented 7 months ago

Hi @sm1thana. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information. Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

glo11372 commented 4 months ago

Hi @sm1thana As this is enhancement ,We will start working on this ticket. Thank You

glo42707 commented 4 months ago

@adobe export jira

glo11372 commented 4 months ago

@adobe export issue to Jira project PWA

github-jira-sync-bot commented 4 months ago

:x: You don't have permission to export this issue.

glo82145 commented 4 months ago

@adobe export issue to Jira project PWA

github-jira-sync-bot commented 4 months ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/PWA-3263 is successfully created for this GitHub issue.

glo11372 commented 4 months ago

@adobe export issue to Jira project PWA

github-jira-sync-bot commented 4 months ago

:x: You don't have permission to export this issue.

glo11372 commented 4 months ago

@adobe export issue to Jira project PWA

github-jira-sync-bot commented 4 months ago

:x: You don't have permission to export this issue.