Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

authentication in strapi

import axios from 'axios';

const { data } = await axios.post('http://localhost:1337/api/auth/local', {
  //identifier is email or username
  identifier: 'reader@strapi.io',
  password: 'strapi',
});

console.log(data);

//data 
{
    "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNTc2OTM4MTUwLCJleHAiOjE1Nzk1MzAxNTB9.UgsjjXkAZ-anD257BF7y1hbjuY3ogNceKfTAQtzDEsU",
    "user": {
        "id": 1,
        "username": "reader",
        ...
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: react native environment variables 
Javascript :: push function in javascript 
Javascript :: bun create react app 
Javascript :: add tab to textarea javascript 
Javascript :: how to check hover effect in js 
Javascript :: node js download file to folder 
Javascript :: js fetch get params 
Javascript :: react hook form reset 
Javascript :: javascript calculate aspect ratio 
Javascript :: time js code 
Javascript :: jquery click on data attribute 
Javascript :: eintegrity npm error 
Javascript :: how to calculate the time complexity of a recursive function 
Javascript :: change port react app 
Javascript :: settimeout js for loop 
Javascript :: javascript toisostring without milliseconds 
Javascript :: connecting nodejs using mongoose 
Javascript :: email regex pattern input css 
Javascript :: jest mock createobjecturl 
Javascript :: varchar max length 
Javascript :: javascript select text in element 
Javascript :: js list of objects 
Javascript :: how to capture a thumbnail from a video 
Javascript :: how to check input is selected or not 
Javascript :: javascript text replace 
Javascript :: express param in url 
Javascript :: how to render react native app under the status bar 
Javascript :: how to load existing json data in nuxt 
Javascript :: how to display image in react js component 
Javascript :: iife js arrow function 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =