Belajar Laravel Lebih Dari Sekedar Fundamental
The account you're visited is private.
The account you're visited is private.
The account you're visited is private.
ags

Agus Apriliawan

Joined 10 September, 2020
Student at Denpasar
We don't know much about them, but we're sure he is great someone.
1
Comments
19.7K
Total experiences
180
Lesson completed

Last Activity

Autentikasi React dengan Laravel dan Laravel SanctumFix login, flickering dan kita kasi loading8:23

Agus Apriliawan

Bang irsyad, untuk permasalahan error inialt

di video ditambahkan user: response.data.data pada setAuth di component Login.js, method login.

const login = async (e) => {
    e.preventDefault()
    try {
        let response = await axios.post('login', credentials)
        localStorage.setItem('tokenUser', response.data.token)
        setAuth({check: true, user: response.data.data})
        redirect.push('/')
    } catch (e) {
        setErrors(e.response.data.errors)
    }
}

itu kan bukan solusi yg terbaik menurut bang irsyad, tapi saya mencoba menghapus user: response.data.data pada setAuth, error seperti gambar masih terjadi, padahal sudah menambahkan mountednya. Berarti user: response.data.data memang harus ditambahkan pada setAuth saat Login ya bang?

Parsinta is a online learning platform intended for web developers.Through series-series such as Laravel, Reactjs, Vuejs, InertiaJs, HTML, Bootstrap, Tailwind CSS, and more.

Parsinta is a Trademark of Irsyad A. Panjaitan. Copyright © 2016 - 2022