L
L
llownall2020-07-12 12:02:33
Django
llownall, 2020-07-12 12:02:33

How to pass auth token from django to vue?

I would like to have a page for authorization with login buttons through social networks, which is generated by django according to a template, and upon successful login, return index.html (for example) - a vue.js application. I want to use the token for api through the header in the future, the question is how to pass this token to vue at the stage of a successful login?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2020-07-12
@grinat

Inlining into a page for example, But IMHO in your case it would be easier and more secure to use cookies.
<script>window.authKey = 'sdsad';</script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question