First implementation of eslint/prettier

This commit is contained in:
Michael
2021-08-10 12:50:47 +02:00
parent fbd57c837c
commit 9bc6fae2c4
52 changed files with 2780 additions and 7675 deletions

View File

@@ -1,6 +1,6 @@
import React, { createContext, useContext, useEffect, useState } from "react";
import React, { createContext, useContext, useEffect, useState } from 'react';
import { supabase } from "utils/supabaseClient";
import { supabase } from 'utils/supabaseClient';
// create a context for authentication
const AuthContext = createContext();
@@ -19,15 +19,15 @@ export const AuthProvider = ({ children }) => {
// Listen for changes on auth state (logged in, signed out, etc.)
const { data: listener } = supabase.auth.onAuthStateChange(
async (event, session) => {
if ((event === "SIGNED_OUT") | (event === "SIGNED_IN")) {
fetch("/api/auth", {
method: "POST",
headers: new Headers({ "Content-Type": "application/json" }),
credentials: "same-origin",
if ((event === 'SIGNED_OUT') | (event === 'SIGNED_IN')) {
fetch('/api/auth', {
method: 'POST',
headers: new Headers({ 'Content-Type': 'application/json' }),
credentials: 'same-origin',
body: JSON.stringify({ event, session }),
}).then((res) => res.json());
}
if (event === "USER_UPDATED") {
if (event === 'USER_UPDATED') {
}
setUser(session?.user ?? null);
setLoading(false);
@@ -56,6 +56,4 @@ export const AuthProvider = ({ children }) => {
};
// export the useAuth hook
export const useAuth = () => {
return useContext(AuthContext);
};
export const useAuth = () => useContext(AuthContext);