🖨️ Print this page Authentication & Token Management
Description
The authentication system in Liberty Framework uses an access token mechanism. A user provides their credentials, and if authenticated, they receive an access token.
Data Structure
Successful Response
Failed Response (Login Error)
Failed Response (Password Error)
Example Usage
import { getToken } from "@nomana-it/liberty-core"
export const AuthenticationExample = async () => {
const response = await getToken ( "admin" , "admin" );
if ( response . status === "success" ) {
console . log ( "Access Token:" , response . access_token );
} else {
console . error ( "Authentication Failed:" , response . message );
}
};
Useful Links
🔗 GitHub Repository (Core): Liberty Core
🔗 GitHub Repository (Test Project): Liberty Test
📖 Live Documentation: Liberty Core Docs
💖 Sponsor & Support: Sponsor Liberty Core