Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/workerd/http.ts>parseBasicAuth

A JavaScript extension package for building strong and modern applications.
Latest
function parseBasicAuth
import { parseBasicAuth } from "https://deno.land/x/ayonli_jsext@v0.9.72/workerd/http.ts";

Parses the Authorization header with the Basic scheme.

Examples

Example 1

import { parseBasicAuth } from "@ayonli/jsext/http";

const auth = parseBasicAuth("Basic cm9vdDpwYSQkdzByZA==");
console.log(auth);
// { username: "root", password: "pa$$w0rd" }

Parameters

str: string