Skip to content

Commit

Permalink
Update API doc
Browse files Browse the repository at this point in the history
  • Loading branch information
artstorm committed Jul 29, 2015
1 parent 9e6f4d8 commit bf0f2a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api/resources/views/documentation/apiary.blade.apib
Expand Up @@ -3,7 +3,7 @@ HOST: {{ $apiUrl }}/

{{-- Inject the model factory so entities be declared with factories --}}
@inject('factory', 'App\Services\ModelFactory')

@inject('jwtAuth', 'Tymon\JWTAuth\JWTAuth')

# Spira API

Expand Down
8 changes: 4 additions & 4 deletions api/resources/views/documentation/sections/auth.blade.apib
Expand Up @@ -18,7 +18,7 @@ Auth uses [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-w

+ Body

{!! $factory->json(\App\Models\AuthToken::class) !!}
{!! $jwtAuth->decode(new Tymon\JWTAuth\Token($jwtAuth->fromUser($factory->make(\App\Models\User::class)))) !!}

## Refresh Token [/auth/jwt/refresh]
*Before* tokens expire they can be renewed with a get request with the current valid token as an `Authorization: Bearer`
Expand All @@ -28,11 +28,11 @@ Auth uses [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-w
+ Request
+ Headers

Authorization: Bearer {!! $factory->make(\App\Models\AuthToken::class)->token !!}
Authorization: Bearer {!! $jwtAuth->fromUser($factory->make(\App\Models\User::class)) !!}

+ Response 200

{!! $factory->json(\App\Models\AuthToken::class) !!}
{!! $jwtAuth->decode(new Tymon\JWTAuth\Token($jwtAuth->fromUser($factory->make(\App\Models\User::class)))) !!}

## Token Login [/auth/jwt/token]
Sometimes a user receives a token in a link by email that is exchanged with an auth token. Tokens are _always_ single
Expand All @@ -46,4 +46,4 @@ Sometimes a user receives a token in a link by email that is exchanged with an a

+ Response 200

{!! $factory->json(\App\Models\AuthToken::class) !!}
{!! $jwtAuth->decode(new Tymon\JWTAuth\Token($jwtAuth->fromUser($factory->make(\App\Models\User::class)))) !!}
10 changes: 5 additions & 5 deletions api/resources/views/documentation/sections/user.blade.apib
Expand Up @@ -16,7 +16,7 @@ with a third party through OAuth)
+ Request
+ Headers

Authorization: Bearer {!! $factory->make(\App\Models\AuthToken::class)->token !!}
Authorization: Bearer {!! $jwtAuth->fromUser($factory->make(\App\Models\User::class)) !!}

+ Response 200 (application/json)

Expand All @@ -36,7 +36,7 @@ with a third party through OAuth)
+ Request
+ Headers

Authorization: Bearer {!! $factory->make(\App\Models\AuthToken::class)->token !!}
Authorization: Bearer {!! $jwtAuth->fromUser($factory->make(\App\Models\User::class)) !!}

+ Response 200 (application/json)

Expand Down Expand Up @@ -81,7 +81,7 @@ password credentials - social signin is described later in this document (@todo)
+ Request
+ Headers

Authorization: Bearer {!! $factory->make(\App\Models\AuthToken::class)->token !!}
Authorization: Bearer {!! $jwtAuth->fromUser($factory->make(\App\Models\User::class)) !!}

+ Body

Expand All @@ -103,7 +103,7 @@ email is sent to the user with a reset token.
+ Request
+ Headers

Authorization: Bearer {!! $factory->make(\App\Models\AuthToken::class)->token !!}
Authorization: Bearer {!! $jwtAuth->fromUser($factory->make(\App\Models\User::class)) !!}

+ Response 202

Expand All @@ -114,6 +114,6 @@ email is sent to the user with a reset token.
+ Request
+ Headers

Authorization: Bearer {!! $factory->make(\App\Models\AuthToken::class)->token !!}
Authorization: Bearer {!! $jwtAuth->fromUser($factory->make(\App\Models\User::class)) !!}

+ Response 204

0 comments on commit bf0f2a7

Please sign in to comment.