fix / AEB-68 account type doesn't displayed correctly

This commit is contained in:
Timofey
2025-10-29 09:56:32 +03:00
parent 6ac5acebba
commit efc9d5c579
9 changed files with 184 additions and 178 deletions

View File

@@ -89,6 +89,7 @@ export const authOptions: NextAuthOptions = {
credentials: {
login: { label: 'Login', type: 'text' },
password: { label: 'Password', type: 'password' },
role: { label: 'Role', type: 'text' },
},
async authorize(credentials) {
try {
@@ -99,20 +100,22 @@ export const authOptions: NextAuthOptions = {
body: JSON.stringify({
login: credentials?.login,
password: credentials?.password,
role: credentials?.role,
}),
})
const raw = await res.text()
let data: {
error?: string;
user?: {
id: string | number;
email: string;
name: string;
};
access?: string;
refresh?: string;
[key: string]: unknown
let data: {
error?: string
user?: {
id: string | number
email: string
name: string
role: string
}
access?: string
refresh?: string
[key: string]: unknown
}
try {
data = JSON.parse(raw)