DTI-Purwadhika / eventhop-be

0 stars 0 forks source link

User Auth #16

Open im-rindu opened 1 week ago

im-rindu commented 1 week ago

request GET auth/login

body request (pakai email & password)

{
    email: "emily.johnson@x.dummyjson.com",
    password: "hfjdj3js9fhgna"
}

body request (pakai oauth)

{
    email: "emily.johnson@x.dummyjson.com",
    provider: "google"
}

response ( email & pass dan oauth responsenya sama)

{
  "id": 1,
  "email": "emily.johnson@x.dummyjson.com",
  "name": "Emily",
  "role": "user",
  "image": "https://dummyjson.com/icon/emilys/128",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MiwidXNlcm5hbWUiOiJtaWNoYWVsdyIsImVtYWlsIjoibWljaGFlbC53aWxsaWFtc0B4LmR1bW15anNvbi5jb20iLCJmaXJzdE5hbWUiOiJNaWNoYWVsIiwibGFzdE5hbWUiOiJXaWxsaWFtcyIsImdlbmRlciI6Im1hbGUiLCJpbWFnZSI6Imh0dHBzOi8vZHVtbXlqc29uLmNvbS9pY29uL21pY2hhZWx3LzEyOCIsImlhdCI6MTcxNzYxMTc0MCwiZXhwIjoxNzE3NjE1MzQwfQ.eQnhQSnS4o0sXZWARh2HsWrEr6XfDT4ngh0ejiykfH8",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MiwidXNlcm5hbWUiOiJtaWNoYWVsdyIsImVtYWlsIjoibWljaGFlbC53aWxsaWFtc0B4LmR1bW15anNvbi5jb20iLCJmaXJzdE5hbWUiOiJNaWNoYWVsIiwibGFzdE5hbWUiOiJXaWxsaWFtcyIsImdlbmRlciI6Im1hbGUiLCJpbWFnZSI6Imh0dHBzOi8vZHVtbXlqc29uLmNvbS9pY29uL21pY2hhZWx3LzEyOCIsImlhdCI6MTcxNzYxMTc0MCwiZXhwIjoxNzIwMjAzNzQwfQ.YsStJdmdUjKOUlbXdqze0nEScCM_RJw9rnuy0RdSn88"
}

url nya bebas, tapi body request ama response nya itu

dari fe ngirim email dan password, dari be ngirim balik

im-rindu commented 1 week ago

referensi https://dummyjson.com/docs/auth