Skip to content

Instantly share code, notes, and snippets.

@teyfix
Created June 21, 2021 19:01
Show Gist options
  • Save teyfix/4d1e99828a830f4a956a3683b5d5d5a0 to your computer and use it in GitHub Desktop.
Save teyfix/4d1e99828a830f4a956a3683b5d5d5a0 to your computer and use it in GitHub Desktop.
vuex - authorizing user
const authorize = async (username, password) => {
const response = await fetch('/login', {
method: 'post',
body: {
username,
password,
},
});
const session = await response.json();
return response;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment