-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add django_auth
to ninja API
#94
Conversation
}: { | ||
messageId: string; | ||
}) => Promise<void>; | ||
deleteMessage: ({ messageId }: { messageId: string }) => Promise<void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by fix
OpenAPI.interceptors.request.use((request: AxiosRequestConfig) => { | ||
const { csrftoken } = cookie.parse(document.cookie); | ||
if (request.headers && csrftoken) { | ||
request.headers["X-CSRFTOKEN"] = csrftoken; | ||
} | ||
return request; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Necessary due to auth=django_auth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but we should provide an easy way for the dev to use token auth too.
Do you think it's enough to allow the user to set the kwargs of API
or provide a init_api
function that we'll call on django_ai_assistant/api/views.py
? See: #55
I'd say the |
Good input. I added that to #55 |
conflict here @pamella |
The conflicts have been fixed |
@amandasavluchinske please make sure to sync with main before writing more tests. |
Issues
Resolves #57
Description
django_auth
to ninja APIconfigAIAssistant
Screencast.from.17-06-2024.18.16.31.webm