Skip to content

Commit

Permalink
chore: next
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Woodward committed Mar 30, 2019
1 parent 1bf41a8 commit cb34310
Show file tree
Hide file tree
Showing 116 changed files with 3,899 additions and 24,111 deletions.
Binary file removed .DS_Store
Binary file not shown.
22 changes: 0 additions & 22 deletions .esdoc.json

This file was deleted.

51 changes: 17 additions & 34 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,25 @@
extends: google
env:
browser: true
plugins:
- compat
parser: '@typescript-eslint/parser'
extends:
- plugin:@typescript-eslint/recommended
- plugin:compat/recommended
parserOptions:
ecmaVersion: 2018
sourceType: module
rules:
indent:
'@typescript-eslint/explicit-function-return-type': off
'@typescript-eslint/indent': [error, 2]
'@typescript-eslint/interface-name-prefix': off
'@typescript-eslint/no-namespace':
- error
- 2
- SwitchCase: 1
compat/compat: 2
comma-dangle:
- error
- arrays: never
objects: never
imports: never
exports: never
functions: never
max-nested-callbacks: 0
no-warning-comments: 0
require-jsdoc: 0
max-len: 0
object-curly-spacing: 0
one-var: 0
arrow-parens: 0
new-cap: 0
camelcase: 0
no-var: 2
prefer-const: 2
no-confusing-arrow: 2
prefer-arrow-callback: 2
switch-colon-spacing: 0
no-invalid-this: 0
- allowDeclarations: true
'@typescript-eslint/camelcase':
- always
- ignoreDestructuring: true
'@typescript-eslint/no-var-requires': off
'@typescript-eslint/no-explicit-any': off
settings:
polyfills:
- url
- Promise
- fetch
- promises

- Request

5 changes: 5 additions & 0 deletions .gitbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root: ./docs

structure:
readme: INTRODUCTION.md
summary: SUMMARY.md
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
node_modules
bower_components
coverage
docs
dist
node_modules/
coverage/
dist/
npm-debug.log*
15 changes: 2 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,16 @@ node_js: stable
cache: npm
branches:
only:
- master
- next
- /^greenkeeper/.*$/
script:
- npm start lint
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm start test.sauce; fi
- npm start test
- if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then npm start build; fi
- npm start docs
after_success:
- npm start report-coverage
- npm start semantic-release
# - npm start semantic-release
addons:
sauce_connect: true
deploy:
provider: pages
skip_cleanup: true
email: bot@salte.io
name: Salte Bot
github_token: $GH_TOKEN
local_dir: docs
on:
branch: master
notifications:
email: change
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test"
],
"internalConsoleOptions": "openOnSessionStart"
}
]
}
139 changes: 30 additions & 109 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<h2 align="center">
<div>
<a href="https://github.com/salte-auth/logos">
<img height="190px" src="https://raw.githubusercontent.com/salte-auth/logos/master/images/logo.svg?sanitize=true">
<br>
<br>
<img height="50px" src="https://raw.githubusercontent.com/salte-auth/logos/master/images/%40salte-auth/salte-auth.svg?sanitize=true">
</a>
</div>
</h2>
<div align="center">
<a href="https://github.com/salte-io/salte-auth">
<img height="180px" src="https://raw.githubusercontent.com/salte-auth/logos/master/images/logo.svg?sanitize=true">
<br>
<br>
<img height="50px" src="https://raw.githubusercontent.com/salte-auth/logos/master/images/%40salte-auth/salte-auth.svg?sanitize=true">
</a>
</div>

<h3 align="center">
OAuth 2.0 for the masses!
Expand All @@ -17,22 +15,22 @@
<strong>
<!-- <a href="https://salte.io">Website</a> -->
<!-- • -->
<a href="https://salte-io.github.io/salte-auth">Docs</a>
<a href="https://salte-auth.gitbook.io/salte-auth">Docs</a>
<a href="https://salte-auth-demo.glitch.me">Demo</a>
</strong>
</p>

<div align="center">

[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Travis][travis-ci-image]][travis-ci-url]
[![Coveralls][coveralls-image]][coveralls-url]

[![semantic-release][semantic-release-image]][semantic-release-url]
[![Greenkeeper badge][greenkeeper-image]][greenkeeper-url]

</div>

## Supported Browsers
Expand All @@ -57,103 +55,35 @@ Here's a list of well known ES6 Promise implementations developed by the communi

## Install

You can install this package either with `npm` or with `bower`.

## npm

```sh
$ npm install @salte-io/salte-auth
```

Then add a `<script>` to your index.html:

```html
<script src="/node_modules/@salte-io/dist/salte-auth.js"></script>
```

Or `require('@salte-io/salte-auth')` from your code.

## bower

```sh
$ bower install salte-io/salte-auth
```

Then add a `<script>` to your index.html:

```html
<script src="/bower_components/salte-auth/dist/salte-auth.js"></script>
```

### HTML Imports (Polymer 1.x - 2.x)

We also support HTML Imports:

```html
<link rel="import" href="/bower_components/salte-auth/salte-auth.html">
```

## ES6 Usage
## Usage

```js
import { SalteAuth } from '@salte-io/salte-auth';
import { SalteAuth } from '@salte-auth/salte-auth';
import { Auth0 } from '@salte-auth/auth0';
import { Redirect } from '@salte-auth/redirect';

// Configure SalteAuth with Auth0's url and client id.
const auth = new SalteAuth({
providerUrl: 'https://salte-alpha.auth0.com',
responseType: 'id_token',
redirectUrl: location.origin,
clientId: 'mM6h2LHJikwdbkvdoiyE8kHhL7gcV8Wb',
scope: 'openid',

routes: [
'http://localhost:8080/account'
],

endpoints: [
'https://jsonplaceholder.typicode.com/posts/1'
providers: [
new Auth0({
url: 'https://salte.auth0.com',
clientID: '12345'
})
],

provider: 'auth0'
handlers: [
new Redirect({
default: true
})
]
});

// Display an iframe to the user that allows them to login
auth.loginWithIframe();
```

## ES5 Usage

```html
<!DOCTYPE html>
<html>
<head>
<script src="/node_modules/@salte-io/salte-auth/dist/salte-auth.js"></script>
<script>
const auth = new salte.SalteAuth({
providerUrl: 'https://salte-alpha.auth0.com',
responseType: 'id_token',
redirectUrl: location.origin,
clientId: 'mM6h2LHJikwdbkvdoiyE8kHhL7gcV8Wb',
scope: 'openid',
routes: [
'http://localhost:8080/account'
],
endpoints: [
'https://jsonplaceholder.typicode.com/posts/1'
],
provider: 'auth0',
});
auth.loginWithIframe();
</script>
</head>
<body>
...
</body>
</html>
auth.login('auth0');
```

## Known Issues
Expand All @@ -164,26 +94,17 @@ _These are issues that we know about, but don't have a clear fix for!_

## Debugging

Debug logging can be enabled by setting a `localStorage` variable of `debug` to `@salte-io/salte-auth*`.

## Documentation

[Click here to view the documentation!](https://salte-io.github.io/salte-auth/)

**Use private or undocumented methods at your own risk, as they will not require a major version bump when breaking changes are made!**
Debug logging can be enabled by setting a `localStorage` variable of `debug` to `@salte-auth/salte-auth*`.

[npm-version-image]: https://img.shields.io/npm/v/@salte-io/salte-auth.svg?style=flat
[npm-downloads-image]: https://img.shields.io/npm/dm/@salte-io/salte-auth.svg?style=flat
[npm-url]: https://npmjs.org/package/@salte-io/salte-auth

[travis-ci-image]: https://img.shields.io/travis/com/salte-io/salte-auth/master.svg?style=flat
[travis-ci-image]: https://img.shields.io/travis/com/salte-io/salte-auth/next.svg?style=flat
[travis-ci-url]: https://travis-ci.com/salte-io/salte-auth

[coveralls-image]: https://img.shields.io/coveralls/salte-io/salte-auth/master.svg
[coveralls-url]: https://coveralls.io/github/salte-io/salte-auth?branch=master

[commitizen-image]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
[commitizen-url]: https://commitizen.github.io/cz-cli/
[coveralls-image]: https://img.shields.io/coveralls/salte-io/salte-auth/next.svg
[coveralls-url]: https://coveralls.io/github/salte-io/salte-auth?branch=next

[semantic-release-url]: https://github.com/semantic-release/semantic-release
[semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
Expand Down
32 changes: 0 additions & 32 deletions bower.json

This file was deleted.

12 changes: 12 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>

<head>
<title>@salte-auth/salte-auth • Demo</title>
</head>

<body>
<script src="./index.ts"></script>
</body>

</html>

0 comments on commit cb34310

Please sign in to comment.