change codeVerifier on codeChallenge
This commit is contained in:
@@ -5,14 +5,14 @@ import { createSession } from '@/app/actions/session';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
|
||||
export async function vkAuthorization(data : any, codeVerifier: string) {
|
||||
export async function vkAuthorization(data : any, codeChallenge: string) {
|
||||
|
||||
console.log(data);
|
||||
console.log(codeVerifier);
|
||||
console.log(codeChallenge);
|
||||
const { code, state, device_id } = data
|
||||
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/api/v1/vk/authorization/${code}/${state}/${codeVerifier}/${device_id}`, {
|
||||
const response = await fetch(`${API_BASE_URL}/api/v1/vk/authorization/${code}/${state}/${codeChallenge}/${device_id}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -21,6 +21,7 @@ export async function vkAuthorization(data : any, codeVerifier: string) {
|
||||
});
|
||||
if (response.ok) {
|
||||
let parsed = await response.json();
|
||||
console.log(parsed);
|
||||
if (parsed.message_desc === 'Operation successful') {
|
||||
/* await createSession(parsed.message_body.token, email); */
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user