bugs fixed
This commit is contained in:
parent
eee6a807da
commit
055869883a
|
@ -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();
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ export default async function updateUserById(
|
|||
id: userId,
|
||||
},
|
||||
});
|
||||
|
||||
if (ssoUser) {
|
||||
// deny changes to SSO-defined properties
|
||||
if (data.email !== user?.email) {
|
||||
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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";
|
||||
|
@ -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;
|
||||
|
|
Ŝarĝante…
Reference in New Issue