Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to login with activated account #45

Open
pqhung3007 opened this issue Oct 22, 2023 · 1 comment
Open

Failed to login with activated account #45

pqhung3007 opened this issue Oct 22, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@pqhung3007
Copy link
Member

pqhung3007 commented Oct 22, 2023

Error: [Error: Invalid value provided to SecureStore. Values must be strings; consider JSON-encoding your values if they are serializable.]

Relevant code block

const loginMutation = useMutation({
    mutationFn: (data: LoginFormSchema) => loginUser(data),
    onSuccess: async (data) => {
      try {
        if (successResponseStatus(data)) {
          await saveToken({
            key: 'access_token',
            value: data.data.access_token
          })
          await saveToken({
            key: 'refresh_token',
            value: data.data.refresh_token
          })
          navigateBasedOnStatus(data.data.user_status, getValues('username'))
        } else {
          Toast.show({
            type: 'error',
            text1: 'Đã có lỗi xảy ra',
            text2: data.message
          })
        }
      } catch (error) {
        console.error(error)
      }
    },
    }

Reason: have not merged to EW-300, where this logic is handled.

@pqhung3007 pqhung3007 added the bug Something isn't working label Oct 22, 2023
@pqhung3007
Copy link
Member Author

Resolved in 62d4d7e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants