Skip to content

Commit

Permalink
Documentation (#43)
Browse files Browse the repository at this point in the history
* docs: lion/spreadsheet v5 documentation added

* docs: lion/request v7 documentation added

* docs: lion/authentication v4 documentation added

* docs: lion/exceptions v1 documentation added

* docs: lion/exceptions v2 documentation added
  • Loading branch information
Sleon4 authored Dec 1, 2024
1 parent 8e7b170 commit a6b578b
Show file tree
Hide file tree
Showing 6 changed files with 2,292 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Tools/Content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ import v8_LF from "./Versions/libraries/files/v8_LF";
import v4_LDI from "./Versions/libraries/dependency-injection/v4_LDI";
import v10_LS from "./Versions/libraries/security/v10_LS";
import v11_LS from "./Versions/libraries/security/v11_LS";
import v7_LR from "./Versions/libraries/request/v7_LR";
import v5_LA from "./Versions/libraries/authentication/v5_LA";
import { version } from "react";
import v1_LE from "./Versions/libraries/exceptions/v1_LE";
import v2_LE from "./Versions/libraries/exceptions/v2_LE";

export default function Content() {
return {
Expand All @@ -64,6 +69,7 @@ export default function Content() {
authentication: {
description: "Library to authenticate users in 2 steps.",
versions: {
v5: v5_LA(),
v4: v4_LA(),
v3: v3_LA(),
v2: v2_LA(),
Expand Down Expand Up @@ -93,6 +99,13 @@ export default function Content() {
v1: v1_LDI(),
},
},
exceptions: {
description: "Handling exceptions and serializations.",
versions: {
v2: v2_LE(),
v1: v1_LE(),
},
},
files: {
description:
"Library created with the function of working internal system files.",
Expand Down Expand Up @@ -123,6 +136,7 @@ export default function Content() {
description:
"Library created to request input data and response requests.",
versions: {
v7: v7_LR(),
v6: v6_LR(),
v5: v5_LR(),
},
Expand Down
156 changes: 156 additions & 0 deletions src/Tools/Versions/libraries/authentication/v5_LA.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import { Alert } from "react-bootstrap";
import CodeBlock from "../../../../pages/components/CodeBlock";
import SupportVersion from "../../../../pages/components/SupportVersion";
import { Fragment } from "react";
import Title from "../../../../pages/components/Title";
import Description from "../../../../pages/components/Description";
import LibraryTitle from "../../../../pages/components/LibraryTitle";

export default function v5_LA() {
return {
"getting-started": {
name: "Getting started",
type: "sub_modules",
list: {
"about-as": {
name: "About us",
code: (
<Fragment>
<Title title={"About us"} />

<Alert variant={"info"}>
<strong>Note: </strong>Currently the library is compatible with
development in Linux environments.
</Alert>

<Description
description={"Library to authenticate users in 2 steps."}
/>
</Fragment>
),
},
install: {
name: "Install",
code: (
<Fragment>
<Title title={"Install"} />

<Alert variant={"info"}>
<strong>Note: </strong>Currently the library is compatible with
development in Linux environments.
</Alert>

<SupportVersion title="Lion-Authentication" version="8.4" />

<CodeBlock
language={"bash"}
content={
"composer require lion/authentication pragmarx/google2fa-qrcode bacon/bacon-qr-code"
}
/>
</Fragment>
),
},
},
},
auth2fa: {
name: "Auth2FA::class",
type: "sub_modules",
list: {
init: {
name: "init",
code: (
<Fragment>
<LibraryTitle className="Auth2FA" methodName="init" />

<Description
description={
"The init method allows initializing the Auth2FA class."
}
/>

<CodeBlock
language="php"
content={`<?php
declare(strict_types=1);
use Lion\\Authentication\\Auth2FA;
Auth2FA::init();
`}
/>
</Fragment>
),
},
qr: {
name: "qr",
code: (
<Fragment>
<LibraryTitle className="Auth2FA" methodName="qr" />

<Description
description={
"The method that returns an object with the qr property where its value is a base_64 of the generated qr code and the secret_key property where it takes the secret value to verify the code."
}
/>

<CodeBlock
language="php"
content={`<?php
declare(strict_types=1);
use Lion\\Authentication\\Auth2FA;
Auth2FA::init()
->qr('company_name', 'company_email');
`}
/>

<CodeBlock
language="php"
content={`<?php
declare(strict_types=1);
use Lion\\Authentication\\Auth2FA;
Auth2FA::init()
->qr('company_name', 'company_email', 200); // default size of 400
`}
/>
</Fragment>
),
},
verify: {
name: "verify",
code: (
<Fragment>
<LibraryTitle className="Auth2FA" methodName="verify" />

<Description
description={
"The verify method verifies that the code obtained is valid."
}
/>

<CodeBlock
language="php"
content={`<?php
declare(strict_types=1);
use Lion\\Authentication\\Auth2FA;
Auth2FA::init()
->verify('secret_key', 'secret_code');
`}
/>
</Fragment>
),
},
},
},
};
}
Loading

0 comments on commit a6b578b

Please sign in to comment.