All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| authSuccessAuthSuccessGet | GET /auth/success | Auth Success |
| githubAuthAuthGithubGet | GET /auth/github | Github Auth |
| githubCallbackAuthCallbackGet | GET /auth/callback | Github Callback |
| loginPageAuthLoginGet | GET /auth/login | Login Page |
| logoutAuthLogoutGet | GET /auth/logout | Logout |
| verifyTokenAuthVerifyGet | GET /auth/verify | Verify Token |
any authSuccessAuthSuccessGet()
Auth Success
Show success page after login.
import { Configuration, AuthApi } from '@saiden/tensors'
import type { AuthSuccessAuthSuccessGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const api = new AuthApi()
try {
const data = await api.authSuccessAuthSuccessGet()
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)This endpoint does not need any parameter.
any
No authorization required
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
any githubAuthAuthGithubGet(returnUrl)
Github Auth
Redirect to GitHub OAuth.
import { Configuration, AuthApi } from '@saiden/tensors'
import type { GithubAuthAuthGithubGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const api = new AuthApi()
const body = {
// string | URL to redirect after login (optional)
returnUrl: returnUrl_example,
} satisfies GithubAuthAuthGithubGetRequest
try {
const data = await api.githubAuthAuthGithubGet(body)
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)| Name | Type | Description | Notes |
|---|---|---|---|
| returnUrl | string |
URL to redirect after login | [Optional] [Defaults to undefined] |
any
No authorization required
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
any githubCallbackAuthCallbackGet(code, state)
Github Callback
Handle GitHub OAuth callback.
import { Configuration, AuthApi } from '@saiden/tensors'
import type { GithubCallbackAuthCallbackGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const api = new AuthApi()
const body = {
// string (optional)
code: code_example,
// string (optional)
state: state_example,
} satisfies GithubCallbackAuthCallbackGetRequest
try {
const data = await api.githubCallbackAuthCallbackGet(body)
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)| Name | Type | Description | Notes |
|---|---|---|---|
| code | string |
[Optional] [Defaults to undefined] |
|
| state | string |
[Optional] [Defaults to undefined] |
any
No authorization required
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
any loginPageAuthLoginGet(returnUrl, error)
Login Page
Show login page.
import { Configuration, AuthApi } from '@saiden/tensors'
import type { LoginPageAuthLoginGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const api = new AuthApi()
const body = {
// string | URL to redirect after login (optional)
returnUrl: returnUrl_example,
// string (optional)
error: error_example,
} satisfies LoginPageAuthLoginGetRequest
try {
const data = await api.loginPageAuthLoginGet(body)
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)| Name | Type | Description | Notes |
|---|---|---|---|
| returnUrl | string |
URL to redirect after login | [Optional] [Defaults to undefined] |
| error | string |
[Optional] [Defaults to undefined] |
any
No authorization required
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
any logoutAuthLogoutGet(returnUrl)
Logout
Clear session and redirect.
import { Configuration, AuthApi } from '@saiden/tensors'
import type { LogoutAuthLogoutGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const api = new AuthApi()
const body = {
// string (optional)
returnUrl: returnUrl_example,
} satisfies LogoutAuthLogoutGetRequest
try {
const data = await api.logoutAuthLogoutGet(body)
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)| Name | Type | Description | Notes |
|---|---|---|---|
| returnUrl | string |
[Optional] [Defaults to undefined] |
any
No authorization required
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
any verifyTokenAuthVerifyGet(token, tensorsSession)
Verify Token
Verify a session token. Returns user info if valid.
import { Configuration, AuthApi } from '@saiden/tensors'
import type { VerifyTokenAuthVerifyGetRequest } from '@saiden/tensors'
async function example() {
console.log('π Testing @saiden/tensors SDK...')
const api = new AuthApi()
const body = {
// string (optional)
token: token_example,
// string (optional)
tensorsSession: tensorsSession_example,
} satisfies VerifyTokenAuthVerifyGetRequest
try {
const data = await api.verifyTokenAuthVerifyGet(body)
console.log(data)
} catch (error) {
console.error(error)
}
}
// Run the test
example().catch(console.error)| Name | Type | Description | Notes |
|---|---|---|---|
| token | string |
[Optional] [Defaults to undefined] |
|
| tensorsSession | string |
[Optional] [Defaults to undefined] |
any
No authorization required
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]