Skip to content

Commit

Permalink
Merge pull request #90 from emil-webkom/POreq
Browse files Browse the repository at this point in the history
Fix: try to fix logging in with google
  • Loading branch information
Mauritzskog authored Sep 21, 2024
2 parents ca5f355 + 9d60cea commit dc69ccd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 24 deletions.
8 changes: 4 additions & 4 deletions frontend/src/auth.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import Google from "next-auth/providers/google";

export default {
providers: [
Google({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
// Google({
// clientId: process.env.GOOGLE_CLIENT_ID,
// clientSecret: process.env.GOOGLE_CLIENT_SECRET,
// }),
Credentials({
async authorize(credentials) {
const validatedFields = LoginSchema.safeParse(credentials);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/admin/lavterskelarrangement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ const LavterskelarrangementComponent = () => {
</h1>
</div>
<div className="w-full px-6 mb-4 text-center">
<div className="font-semibold:">Filtrer</div>
<div className="font-semibold:">Filtrer:</div>
<select
value={showPastEvents ? "future" : "all"}
onChange={(e) => setShowPastEvents(e.target.value === "future")}
className=""
className="p-2 border border-gray-300 rounded"
>
<option value="all">Kommende arrangementer</option>
<option value="future">Alle arrangementer</option>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/auth/login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const LoginForm = () => {
<Input
{...field}
disabled={isPending}
placeholder="emil@elgen.no"
placeholder="[email protected].no"
type="email"
/>
</FormControl>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/auth/register-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const RegisterForm = () => {
<Input
{...field}
disabled={isPending}
placeholder="ola@gmail.no"
placeholder="ola[email protected].no"
type="email"
/>
</FormControl>
Expand Down
29 changes: 13 additions & 16 deletions frontend/src/components/footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,10 @@ const Footer: FC = () => {

const [komiteLeder, setKomiteLeder] = useState<Komite>();

const setKomite = () => {
if (komiteData) {
const komite = komiteData.find((item) => item.navn === "Emil Link");
setKomiteLeder(komite);
}
};

// Fetch and set Hovedstyret data
const fetchStyretData = async () => {
try {
const response = await fetch("/api/styret");
const result = await response.json();
setKomite();
if (response.ok) {
setStyret(result.data); // Assuming the API returns { data: hovedstyret[] }
} else {
Expand All @@ -60,16 +51,22 @@ const Footer: FC = () => {
useEffect(() => {
fetchStyretData();

if (komiteData) {
const komite = komiteData.find((item) => item.navn === "Emil Link");
setKomiteLeder(komite);
}

if (samarbeidspartnerData) {
setLogos(samarbeidspartnerData?.data);
setLogos(samarbeidspartnerData.data);
}
}, [samarbeidspartnerData]);

useEffect(() => {
// Find and set the leader (Kongsknekt leder)
const foundLeder = styret.find((item) => item.rolle === "Kongsknekt leder");
setLeder(foundLeder);
}, [styret]);
if (styret.length > 0) {
const foundLeder = styret.find(
(item) => item.rolle === "Kongsknekt leder",
);
setLeder(foundLeder);
}
}, [komiteData, samarbeidspartnerData]);

const toggleModal = () => {
setOpenModal((prevState) => !prevState);
Expand Down

0 comments on commit dc69ccd

Please sign in to comment.