Skip to content

Tag 25 Spring Security 2

Levin Cagatay edited this page Apr 13, 2023 · 9 revisions

Spring Security (Frontend)

Änderungen im Frontend

  • LoginPage erstellen (bestenfalls mit form, useState für einen User)
  • login function erstellen (axios.post mit body=undefined in einem custom-hook)
function login(username: string, password: string) {
        return axios.post("/api/users/login", undefined, {auth: {username, password}})
            .then(response => {
                setUser(response.data)
            })
    }

Änderungen im Backend

  • Request im Controller erstellen (Request-Typ egal, empfohlen POST)

Clone this wiki locally