import { ref } from 'vue'

const phone = ref('')
const token = ref('')

export const usePasswordReset = () => {
  const setResetTicket = ({ phone: phoneNumber, token: resetToken }) => {
    if (phoneNumber) phone.value = phoneNumber
    if (resetToken) token.value = resetToken
  }

  const clearResetTicket = () => {
    phone.value = ''
    token.value = ''
  }

  return { phone, token, setResetTicket, clearResetTicket }
}

export default usePasswordReset
