fix / AEB-68 account type doesn't displayed correctly
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user