change user_name still used as login and add display_name for dashboard view instead of username on login
This commit is contained in:
1 parent
7a562c18ec
commit
11b0ca26a5
33 files changed
+180
-145
No files matched your search
@@ -42,7 +42,7 @@ describe('apiClient', () => {
|
||||
|
||||
it('sends CSRF token on POST', async () => {
|
||||
document.cookie = 'csrftoken=abc123; path=/';
|
||||
const fetchMock = vi.fn().mockResolvedValue(jsonResponse({ id: 1, user_name: 'admin' }));
|
||||
const fetchMock = vi.fn().mockResolvedValue(jsonResponse({ id: 1, user_name: 'admin', display_name: 'admin' }));
|
||||
vi.stubGlobal('fetch', fetchMock);
|
||||
|
||||
await api.auth.login('admin', 'admin123');
|
||||
|
||||
@@ -159,8 +159,8 @@ const del = (path: string) => request<void>(path, { method: 'DELETE' });
|
||||
export const api = {
|
||||
auth: {
|
||||
csrf: () => get<{ csrfToken: string }>('/auth/csrf/'),
|
||||
login: (user_login: string, password: string) =>
|
||||
post<User>('/auth/login/', { user_login, password }),
|
||||
login: (user_name: string, password: string) =>
|
||||
post<User>('/auth/login/', { user_name, password }),
|
||||
logout: () => post<void>('/auth/logout/'),
|
||||
me: () => get<User>('/auth/me/'),
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user