
<template>
    <div>
      <h2>Register</h2>
      <form @submit.prevent="register">
        <input v-model="email" type="email" placeholder="Email" required />
        <input v-model="password" type="password" placeholder="Password" required />
        <button type="submit">Register</button>
      </form>
    </div>
  </template>
  
  <script>
  import axios from 'axios';
  
  export default {
    data() {
      return {
        email: '',
        password: '',
      };
    },
    methods: {
      async register() {
        try {
          await axios.post('/api/auth/register', { email: this.email, password: this.password });
          alert('Registration successful! Please check your email to activate your account.');
        } catch (error) {
          console.error(error);
          alert('Registration failed.');
        }
      },
    },
  };
  </script>
  