Skip to content

Commit

Permalink
README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
francis94c committed Jul 21, 2019
1 parent a135ed8 commit 4f49184
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Download and Install Splint from https://splint.cynobit.com/downloads/splint and
```bash
splint install francis94c/blog
```
## Usage ##
## Documentation ##
Load the package and initialize as needed.
```php
$this->load->package("francis94c/ci-jwt");
Expand All @@ -23,6 +23,23 @@ $params = [
"allow_unsigned" => false,
"auto_expire" => "+30 Days"
];
$this->jwt-.init($params);
$this->jwt->init($params);
```
### Config/Initialization Parameters ###
| Name | Description |
| ---------------- | --------------------------------------------------------------------------------------- |
| `secret` | The Secret Key used to Sign and Verify Tokens |
| `algorithm` | The Algorithm used to Sign and Verify Tokens. e.g. HS256 |
| `allow_unsigned` | Set this to `true` if you want the `verify` function to return `true` for unsigned token. This config is set to false by default. |
| `auto_expire` | Sets the time at which all tokens generated should be considered expired automatically. |

### Methods ###
`init(array $config)`
This function allows you to set a couple of options that influences the behaviour of the library.
#### Example ####
```php
$this->jwt->init([
"algorithm" => JWT::HS512,
"auto_expire" => "+30 Days"
]);
```
### Config/Initialization Parameter ###

0 comments on commit 4f49184

Please sign in to comment.