Verify a magic link token
curl --request GET \
--url https://closedvpn.io/auth/verify-magic-linkimport requests
url = "https://closedvpn.io/auth/verify-magic-link"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://closedvpn.io/auth/verify-magic-link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://closedvpn.io/auth/verify-magic-link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://closedvpn.io/auth/verify-magic-link"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://closedvpn.io/auth/verify-magic-link")
.asString();require 'uri'
require 'net/http'
url = URI("https://closedvpn.io/auth/verify-magic-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Token validated successfully",
"userId": "60c72b2f5f1b2c001c8e4b1b",
"email": "[email protected]",
"name": "John Doe",
"givenName": "John",
"surname": "Doe",
"avatar": "JD",
"phoneNumber": "+441234567890",
"companyName": "Acme Ltd",
"receiveNotifications": true,
"receivePromotional": false
}{
"success": false,
"message": "Invalid request"
}{
"success": false,
"message": "Token expired",
"error": "Detailed error message"
}Authentication
Verify Magic Link
Validates the magic link token from the email. Upon success, sets an authentication cookie and returns user info, allowing PAT generation via /auth/generate-pat. This endpoint does not require PAT authentication; it uses the token query parameter for verification.
GET
/
auth
/
verify-magic-link
Verify a magic link token
curl --request GET \
--url https://closedvpn.io/auth/verify-magic-linkimport requests
url = "https://closedvpn.io/auth/verify-magic-link"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://closedvpn.io/auth/verify-magic-link', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://closedvpn.io/auth/verify-magic-link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://closedvpn.io/auth/verify-magic-link"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://closedvpn.io/auth/verify-magic-link")
.asString();require 'uri'
require 'net/http'
url = URI("https://closedvpn.io/auth/verify-magic-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Token validated successfully",
"userId": "60c72b2f5f1b2c001c8e4b1b",
"email": "[email protected]",
"name": "John Doe",
"givenName": "John",
"surname": "Doe",
"avatar": "JD",
"phoneNumber": "+441234567890",
"companyName": "Acme Ltd",
"receiveNotifications": true,
"receivePromotional": false
}{
"success": false,
"message": "Invalid request"
}{
"success": false,
"message": "Token expired",
"error": "Detailed error message"
}Query Parameters
Magic link token from the email
Example:
"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
Response
Token validated successfully
Example:
true
Example:
"Token validated successfully"
Example:
"60c72b2f5f1b2c001c8e4b1b"
Example:
Example:
"John Doe"
Example:
"John"
Example:
"Doe"
Example:
"JD"
Example:
"+441234567890"
Example:
"Acme Ltd"
Example:
true
Example:
false

