This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const o_O = (promise) => { | |
return promise.then(data => { | |
if(data instanceof Error) return [data] | |
return [null, data] | |
}).catch(err => [err]) | |
} | |
// Create Search Url | |
export const urlString = (str) => { | |
return str.toLowerCase().replace(new RegExp(' ', 'g'), '+'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { signOut, signInWithEmailAndPassword, createUserWithEmailAndPassword, updatePassword, updateEmail, deleteUser } from "firebase/auth" | |
import { auth } from "../firebase.config" | |
import { errorResponse } from '../helpers/FirebaseErrorResponse'; | |
import { ref } from "vue"; | |
import router from "../router"; | |
export const useFirebaseAuth = () => { | |
const user = auth.currentUser; | |
const isLoading = ref(false) | |
const error = ref('') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let errorResponses = { | |
'auth/email-already-in-use': 'The email provided already exists.', | |
'auth/user-not-found': 'User not found. Please check your credentials and try again.', | |
'auth/email-not-found': 'Email address not found. Please check your credentials and try again.', | |
'auth/operation-not-allowed': 'Operation not allowed.', | |
'auth/invalid-email': 'The provided email is not valid.', | |
'auth/weak-password': 'The password provided is too weak.', | |
'auth/wrong-password': 'The provided password is incorrect.', | |
'auth/user-disabled': "The user's account has been disabled or deleted.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { signOut, signInWithEmailAndPassword, createUserWithEmailAndPassword, updatePassword, updateEmail, deleteUser } from "firebase/auth" | |
import { auth } from "../firebase.config" | |
import { useAuthStore } from "../stores/auth" | |
import { errorResponse } from "../helpers/firebaseErrorResponse"; | |
import { useState } from "react"; | |
import router from "../router"; | |
export const useFirebaseAuth = () => { | |
const user = auth.currentUser; | |
const authStore = useAuthStore() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const NotificationBar = ({ active=true }) => { | |
return ( | |
<> | |
<div className={ | |
`fixed z-[500] bottom-4 right-2 transition-transform duration-[0.8s] ease-[ease-in-out] | |
${active ? 'translate-y-[-10%]' : 'translate-y-[120%]'}` | |
}> | |
<div | |
className="relative block w-full max-w-sm rounded-lg bg-green-500 px-4 py-2 text-base text-white" | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function useForm(fields) { | |
let defaults = fields; | |
let recentlySuccessfulTimeoutId; | |
const form = reactive({ | |
fields: JSON.parse(JSON.stringify(fields)), | |
errors: {}, | |
dirty: false, | |
hasErrors: false, | |
processing: false, |