Lewati ke konten utama

refresh

Perbarui token pengguna.

Deskripsi

Metode ini memperbarui token pengguna. Mengembalikan objek dengan sekumpulan token. Ini mengembalikan Promise yang menyelesaikan menjadi objek IAuthEntity.

AuthProvider.refresh(

marker*, token*

);

Skema parameter

Skema

marker(wajib): string
Pengidentifikasi teks dari penyedia otorisasi
contoh: "email"

token(wajib): string
Token penyegaran
contoh: "abcdef123456"

Contoh

Contoh minimal

const response = await AuthProvider.refresh('email', '1714557670334-cb85112d-618d-4b2a-bad5-137b19c135b9');

Contoh respons

{
"userIdentifier": "test@test.ru",
"authProviderIdentifier": "email",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX...",
"refreshToken": "1780843257749-0b6bc74a-f51c-4a1c..."
}

Skema respons

Skema: IAuthEntity

userIdentifier: string
Pengidentifikasi unik untuk pengguna.
contoh: "user12345"

authProviderIdentifier: string
Pengidentifikasi untuk penyedia otentikasi.
contoh: "email"

accessToken: string
Token akses untuk sesi pengguna.
contoh: "abcdef123456"

refreshToken: string
Token penyegaran untuk memperbarui token akses.
contoh: "ghijkl789012"