Skip to content

Commit

Permalink
Merge pull request #379 from linkwarden/dev
Browse files Browse the repository at this point in the history
bugs fixed
  • Loading branch information
daniel31x13 committed Dec 30, 2023
2 parents a5d3926 + 0558698 commit dea1e12
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/SettingsSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useRouter } from "next/router";
import React, { useEffect, useState } from "react";

export default function SettingsSidebar({ className }: { className?: string }) {
const LINKWARDEN_VERSION = "v2.4.0";
const LINKWARDEN_VERSION = "v2.4.4";

const { collections } = useCollectionStore();

Expand Down
3 changes: 2 additions & 1 deletion lib/api/controllers/users/userId/updateUserById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default async function updateUserById(
id: userId,
},
});

if (ssoUser) {
// deny changes to SSO-defined properties
if (data.email !== user?.email) {
Expand All @@ -49,7 +50,7 @@ export default async function updateUserById(
status: 400,
};
}
if (data.image !== "") {
if (data.image?.startsWith("data:image/jpeg;base64")) {
return {
response: "SSO Users cannot change their avatar.",
status: 400,
Expand Down
6 changes: 4 additions & 2 deletions pages/api/v1/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ if (process.env.NEXT_PUBLIC_AUTHENTIK_ENABLED === "true") {
profile: (profile) => {
return {
id: profile.sub,
name: profile.name ?? profile.preferred_username,
username: profile.preferred_username,
name: profile.name || "",
email: profile.email,
image: profile.picture,
};
Expand Down Expand Up @@ -589,7 +590,8 @@ if (process.env.NEXT_PUBLIC_KEYCLOAK_ENABLED === "true") {
profile: (profile) => {
return {
id: profile.sub,
name: profile.name ?? profile.preferred_username,
username: profile.preferred_username,
name: profile.name || "",
email: profile.email,
image: profile.picture,
};
Expand Down
7 changes: 3 additions & 4 deletions pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TextInput from "@/components/TextInput";
import CenteredForm from "@/layouts/CenteredForm";
import { signIn } from "next-auth/react";
import Link from "next/link";
import { useState, FormEvent } from "react";
import React, { useState, FormEvent } from "react";
import { toast } from "react-hot-toast";
import { getLogins } from "./api/v1/logins";
import { InferGetServerSidePropsType } from "next";
Expand Down Expand Up @@ -131,18 +131,17 @@ export default function Login({
const Buttons: any = [];
availableLogins.buttonAuths.forEach((value, index) => {
Buttons.push(
<>
<React.Fragment key={index}>
{index !== 0 ? <div className="divider my-1">OR</div> : undefined}

<AccentSubmitButton
key={index}
type="button"
onClick={() => loginUserButton(value.method)}
label={`Sign in with ${value.name}`}
className=" w-full text-center"
loading={submitLoader}
/>
</>
</React.Fragment>
);
});
return Buttons;
Expand Down

0 comments on commit dea1e12

Please sign in to comment.