Remove old version of the frontend.

pull/474/head
Clement Michaud 2019-11-30 15:28:06 +01:00 committed by Clément Michaud
parent 17eaeabdf9
commit 1617d98b11
105 changed files with 0 additions and 22525 deletions

View File

@ -1,3 +0,0 @@
HOST=authelia-frontend
REACT_APP_CSP_CONTENT="default-src 'unsafe-inline'; script-src * 'unsafe-inline'; img-src * data:; style-src 'unsafe-inline'; connect-src * 'unsafe-inline' extensions:"

View File

@ -1,2 +0,0 @@
REACT_APP_CSP_CONTENT="default-src 'self'; style-src 'self'; script-src 'self'; img-src 'self' data:"

23
client/.gitignore vendored
View File

@ -1,23 +0,0 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View File

@ -1,9 +0,0 @@
FROM node:10.15.0-jessie
WORKDIR /usr/app/client
ADD package.json package.json
RUN npm i
CMD ["npm", "start"]

View File

@ -1,44 +0,0 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br>
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).

View File

@ -1,15 +0,0 @@
version: '2'
services:
authelia-frontend-dev:
build:
context: client
restart: always
volumes:
- ./client/tsconfig.json:/usr/app/client/tsconfig.json
- ./client/public:/usr/app/client/public
- ./client/src:/usr/app/client/src
- ./client/.env.development:/usr/app/client/.env.development
networks:
authelianet:
aliases:
- authelia-frontend

17953
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +0,0 @@
{
"name": "authelia-portal",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material/react-button": "^0.8.0",
"@material/react-checkbox": "^0.8.0",
"@material/react-text-field": "^0.8.0",
"@types/classnames": "^2.2.7",
"@types/jss": "^9.5.7",
"@types/node": "^10.12.2",
"@types/node-sass": "^3.10.32",
"@types/qrcode.react": "^0.8.1",
"@types/query-string": "^6.2.0",
"@types/react": "^16.4.18",
"@types/react-dom": "^16.0.9",
"@types/react-redux": "^6.0.12",
"@types/react-router-dom": "^4.3.1",
"@types/redux-thunk": "^2.1.0",
"classnames": "^2.2.6",
"connected-react-router": "^6.2.1",
"node-sass": "^4.11.0",
"qrcode.react": "^0.9.2",
"query-string": "^6.2.0",
"react": "^16.10.2",
"react-dom": "^16.6.0",
"react-redux": "^6.0.0",
"react-router-dom": "^4.3.1",
"react-scripts": "^2.1.3",
"redux-thunk": "^2.3.0",
"typesafe-actions": "^3.0.0",
"typescript": "^3.1.6",
"u2f-api": "^1.0.10",
"utility-types": "^3.4.1"
},
"scripts": {
"start": "SASS_PATH=./node_modules react-scripts start",
"build": "INLINE_RUNTIME_CHUNK=false SASS_PATH=./node_modules react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"proxy": "http://authelia-backend:9091/"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,42 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="noindex, nofollow, nosnippet, noarchive">
<meta http-equiv="Content-Security-Policy" content="%REACT_APP_CSP_CONTENT%">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Authelia - Portal</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

View File

@ -1,13 +0,0 @@
{
"short_name": "Authelia",
"name": "Authelia - Portal",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone"
}

View File

@ -1,3 +0,0 @@
@import "@material/react-button/index.scss";
@import "@material/react-checkbox/index.scss";
@import "@material/react-text-field/index.scss";

View File

@ -1,9 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});

View File

@ -1,42 +0,0 @@
import React, { Component } from 'react';
import './App.scss';
import { Route, Switch } from "react-router-dom";
import { routes } from './routes/index';
import { createHashHistory } from 'history';
import { createStore, applyMiddleware, compose } from 'redux';
import reducer from './reducers';
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';
import { routerMiddleware, ConnectedRouter } from 'connected-react-router';
const history = createHashHistory();
const store = createStore(
reducer(history),
compose(
applyMiddleware(
routerMiddleware(history),
thunk
)
)
);
class App extends Component {
render() {
return (
<Provider store={store}>
<ConnectedRouter history={history}>
<div className="App">
<Switch>
{routes.map((r, key) => {
return <Route path={r.path} component={r.component} key={key}/>
})}
</Switch>
</div>
</ConnectedRouter>
</Provider>
);
}
}
export default App;

View File

@ -1,129 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="US_UK_Download_on_the" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" width="135px" height="40px" viewBox="0 0 135 40" enable-background="new 0 0 135 40" xml:space="preserve">
<g>
<path fill="#A6A6A6" d="M130.197,40H4.729C2.122,40,0,37.872,0,35.267V4.726C0,2.12,2.122,0,4.729,0h125.468
C132.803,0,135,2.12,135,4.726v30.541C135,37.872,132.803,40,130.197,40L130.197,40z"/>
<path d="M134.032,35.268c0,2.116-1.714,3.83-3.834,3.83H4.729c-2.119,0-3.839-1.714-3.839-3.83V4.725
c0-2.115,1.72-3.835,3.839-3.835h125.468c2.121,0,3.834,1.72,3.834,3.835L134.032,35.268L134.032,35.268z"/>
<g>
<g>
<path fill="#FFFFFF" d="M30.128,19.784c-0.029-3.223,2.639-4.791,2.761-4.864c-1.511-2.203-3.853-2.504-4.676-2.528
c-1.967-0.207-3.875,1.177-4.877,1.177c-1.022,0-2.565-1.157-4.228-1.123c-2.14,0.033-4.142,1.272-5.24,3.196
c-2.266,3.923-0.576,9.688,1.595,12.859c1.086,1.553,2.355,3.287,4.016,3.226c1.625-0.067,2.232-1.036,4.193-1.036
c1.943,0,2.513,1.036,4.207,0.997c1.744-0.028,2.842-1.56,3.89-3.127c1.255-1.78,1.759-3.533,1.779-3.623
C33.507,24.924,30.161,23.647,30.128,19.784z"/>
<path fill="#FFFFFF" d="M26.928,10.306c0.874-1.093,1.472-2.58,1.306-4.089c-1.265,0.056-2.847,0.875-3.758,1.944
c-0.806,0.942-1.526,2.486-1.34,3.938C24.557,12.205,26.016,11.382,26.928,10.306z"/>
</g>
</g>
<g>
<path fill="#FFFFFF" d="M53.645,31.504h-2.271l-1.244-3.909h-4.324l-1.185,3.909h-2.211l4.284-13.308h2.646L53.645,31.504z
M49.755,25.955L48.63,22.48c-0.119-0.355-0.342-1.191-0.671-2.507h-0.04c-0.131,0.566-0.342,1.402-0.632,2.507l-1.105,3.475
H49.755z"/>
<path fill="#FFFFFF" d="M64.662,26.588c0,1.632-0.441,2.922-1.323,3.869c-0.79,0.843-1.771,1.264-2.942,1.264
c-1.264,0-2.172-0.454-2.725-1.362h-0.04v5.055h-2.132V25.067c0-1.026-0.027-2.079-0.079-3.159h1.875l0.119,1.521h0.04
c0.711-1.146,1.79-1.718,3.238-1.718c1.132,0,2.077,0.447,2.833,1.342C64.284,23.949,64.662,25.127,64.662,26.588z M62.49,26.666
c0-0.934-0.21-1.704-0.632-2.31c-0.461-0.632-1.08-0.948-1.856-0.948c-0.526,0-1.004,0.176-1.431,0.523
c-0.428,0.35-0.708,0.807-0.839,1.373c-0.066,0.264-0.099,0.48-0.099,0.65v1.6c0,0.698,0.214,1.287,0.642,1.768
s0.984,0.721,1.668,0.721c0.803,0,1.428-0.31,1.875-0.928C62.266,28.496,62.49,27.68,62.49,26.666z"/>
<path fill="#FFFFFF" d="M75.699,26.588c0,1.632-0.441,2.922-1.324,3.869c-0.789,0.843-1.77,1.264-2.941,1.264
c-1.264,0-2.172-0.454-2.724-1.362H68.67v5.055h-2.132V25.067c0-1.026-0.027-2.079-0.079-3.159h1.875l0.119,1.521h0.04
c0.71-1.146,1.789-1.718,3.238-1.718c1.131,0,2.076,0.447,2.834,1.342C75.32,23.949,75.699,25.127,75.699,26.588z M73.527,26.666
c0-0.934-0.211-1.704-0.633-2.31c-0.461-0.632-1.078-0.948-1.855-0.948c-0.527,0-1.004,0.176-1.432,0.523
c-0.428,0.35-0.707,0.807-0.838,1.373c-0.065,0.264-0.099,0.48-0.099,0.65v1.6c0,0.698,0.214,1.287,0.64,1.768
c0.428,0.48,0.984,0.721,1.67,0.721c0.803,0,1.428-0.31,1.875-0.928C73.303,28.496,73.527,27.68,73.527,26.666z"/>
<path fill="#FFFFFF" d="M88.039,27.772c0,1.132-0.393,2.053-1.182,2.764c-0.867,0.777-2.074,1.165-3.625,1.165
c-1.432,0-2.58-0.276-3.449-0.829l0.494-1.777c0.936,0.566,1.963,0.85,3.082,0.85c0.803,0,1.428-0.182,1.877-0.544
c0.447-0.362,0.67-0.848,0.67-1.454c0-0.54-0.184-0.995-0.553-1.364c-0.367-0.369-0.98-0.712-1.836-1.029
c-2.33-0.869-3.494-2.142-3.494-3.816c0-1.094,0.408-1.991,1.225-2.689c0.814-0.699,1.9-1.048,3.258-1.048
c1.211,0,2.217,0.211,3.02,0.632l-0.533,1.738c-0.75-0.408-1.598-0.612-2.547-0.612c-0.75,0-1.336,0.185-1.756,0.553
c-0.355,0.329-0.533,0.73-0.533,1.205c0,0.526,0.203,0.961,0.611,1.303c0.355,0.316,1,0.658,1.936,1.027
c1.145,0.461,1.986,1,2.527,1.618C87.77,26.081,88.039,26.852,88.039,27.772z"/>
<path fill="#FFFFFF" d="M95.088,23.508h-2.35v4.659c0,1.185,0.414,1.777,1.244,1.777c0.381,0,0.697-0.033,0.947-0.099l0.059,1.619
c-0.42,0.157-0.973,0.236-1.658,0.236c-0.842,0-1.5-0.257-1.975-0.77c-0.473-0.514-0.711-1.376-0.711-2.587v-4.837h-1.4v-1.6h1.4
v-1.757l2.094-0.632v2.389h2.35V23.508z"/>
<path fill="#FFFFFF" d="M105.691,26.627c0,1.475-0.422,2.686-1.264,3.633c-0.883,0.975-2.055,1.461-3.516,1.461
c-1.408,0-2.529-0.467-3.365-1.401s-1.254-2.113-1.254-3.534c0-1.487,0.43-2.705,1.293-3.652c0.861-0.948,2.023-1.422,3.484-1.422
c1.408,0,2.541,0.467,3.396,1.402C105.283,24.021,105.691,25.192,105.691,26.627z M103.479,26.696
c0-0.885-0.189-1.644-0.572-2.277c-0.447-0.766-1.086-1.148-1.914-1.148c-0.857,0-1.508,0.383-1.955,1.148
c-0.383,0.634-0.572,1.405-0.572,2.317c0,0.885,0.189,1.644,0.572,2.276c0.461,0.766,1.105,1.148,1.936,1.148
c0.814,0,1.453-0.39,1.914-1.168C103.281,28.347,103.479,27.58,103.479,26.696z"/>
<path fill="#FFFFFF" d="M112.621,23.783c-0.211-0.039-0.436-0.059-0.672-0.059c-0.75,0-1.33,0.283-1.738,0.85
c-0.355,0.5-0.533,1.132-0.533,1.895v5.035h-2.131l0.02-6.574c0-1.106-0.027-2.113-0.08-3.021h1.857l0.078,1.836h0.059
c0.225-0.631,0.58-1.139,1.066-1.52c0.475-0.343,0.988-0.514,1.541-0.514c0.197,0,0.375,0.014,0.533,0.039V23.783z"/>
<path fill="#FFFFFF" d="M122.156,26.252c0,0.382-0.025,0.704-0.078,0.967h-6.396c0.025,0.948,0.334,1.673,0.928,2.173
c0.539,0.447,1.236,0.671,2.092,0.671c0.947,0,1.811-0.151,2.588-0.454l0.334,1.48c-0.908,0.396-1.98,0.593-3.217,0.593
c-1.488,0-2.656-0.438-3.506-1.313c-0.848-0.875-1.273-2.05-1.273-3.524c0-1.447,0.395-2.652,1.186-3.613
c0.828-1.026,1.947-1.539,3.355-1.539c1.383,0,2.43,0.513,3.141,1.539C121.873,24.047,122.156,25.055,122.156,26.252z
M120.123,25.699c0.014-0.632-0.125-1.178-0.414-1.639c-0.369-0.593-0.936-0.889-1.699-0.889c-0.697,0-1.264,0.289-1.697,0.869
c-0.355,0.461-0.566,1.014-0.631,1.658H120.123z"/>
</g>
<g>
<g>
<path fill="#FFFFFF" d="M49.05,10.009c0,1.177-0.353,2.063-1.058,2.658c-0.653,0.549-1.581,0.824-2.783,0.824
c-0.596,0-1.106-0.026-1.533-0.078V6.982c0.557-0.09,1.157-0.136,1.805-0.136c1.145,0,2.008,0.249,2.59,0.747
C48.723,8.156,49.05,8.961,49.05,10.009z M47.945,10.038c0-0.763-0.202-1.348-0.606-1.756c-0.404-0.407-0.994-0.611-1.771-0.611
c-0.33,0-0.611,0.022-0.844,0.068v4.889c0.129,0.02,0.365,0.029,0.708,0.029c0.802,0,1.421-0.223,1.857-0.669
S47.945,10.892,47.945,10.038z"/>
<path fill="#FFFFFF" d="M54.909,11.037c0,0.725-0.207,1.319-0.621,1.785c-0.434,0.479-1.009,0.718-1.727,0.718
c-0.692,0-1.243-0.229-1.654-0.689c-0.41-0.459-0.615-1.038-0.615-1.736c0-0.73,0.211-1.329,0.635-1.794s0.994-0.698,1.712-0.698
c0.692,0,1.248,0.229,1.669,0.688C54.708,9.757,54.909,10.333,54.909,11.037z M53.822,11.071c0-0.435-0.094-0.808-0.281-1.119
c-0.22-0.376-0.533-0.564-0.94-0.564c-0.421,0-0.741,0.188-0.961,0.564c-0.188,0.311-0.281,0.69-0.281,1.138
c0,0.435,0.094,0.808,0.281,1.119c0.227,0.376,0.543,0.564,0.951,0.564c0.4,0,0.714-0.191,0.94-0.574
C53.725,11.882,53.822,11.506,53.822,11.071z"/>
<path fill="#FFFFFF" d="M62.765,8.719l-1.475,4.714h-0.96l-0.611-2.047c-0.155-0.511-0.281-1.019-0.379-1.523h-0.019
c-0.091,0.518-0.217,1.025-0.379,1.523l-0.649,2.047h-0.971l-1.387-4.714h1.077l0.533,2.241c0.129,0.53,0.235,1.035,0.32,1.513
h0.019c0.078-0.394,0.207-0.896,0.389-1.503l0.669-2.25h0.854l0.641,2.202c0.155,0.537,0.281,1.054,0.378,1.552h0.029
c0.071-0.485,0.178-1.002,0.32-1.552l0.572-2.202H62.765z"/>
<path fill="#FFFFFF" d="M68.198,13.433H67.15v-2.7c0-0.832-0.316-1.248-0.95-1.248c-0.311,0-0.562,0.114-0.757,0.343
c-0.193,0.229-0.291,0.499-0.291,0.808v2.796h-1.048v-3.366c0-0.414-0.013-0.863-0.038-1.349h0.921l0.049,0.737h0.029
c0.122-0.229,0.304-0.418,0.543-0.569c0.284-0.176,0.602-0.265,0.95-0.265c0.44,0,0.806,0.142,1.097,0.427
c0.362,0.349,0.543,0.87,0.543,1.562V13.433z"/>
<path fill="#FFFFFF" d="M71.088,13.433h-1.047V6.556h1.047V13.433z"/>
<path fill="#FFFFFF" d="M77.258,11.037c0,0.725-0.207,1.319-0.621,1.785c-0.434,0.479-1.01,0.718-1.727,0.718
c-0.693,0-1.244-0.229-1.654-0.689c-0.41-0.459-0.615-1.038-0.615-1.736c0-0.73,0.211-1.329,0.635-1.794s0.994-0.698,1.711-0.698
c0.693,0,1.248,0.229,1.67,0.688C77.057,9.757,77.258,10.333,77.258,11.037z M76.17,11.071c0-0.435-0.094-0.808-0.281-1.119
c-0.219-0.376-0.533-0.564-0.939-0.564c-0.422,0-0.742,0.188-0.961,0.564c-0.188,0.311-0.281,0.69-0.281,1.138
c0,0.435,0.094,0.808,0.281,1.119c0.227,0.376,0.543,0.564,0.951,0.564c0.4,0,0.713-0.191,0.939-0.574
C76.074,11.882,76.17,11.506,76.17,11.071z"/>
<path fill="#FFFFFF" d="M82.33,13.433h-0.941l-0.078-0.543h-0.029c-0.322,0.433-0.781,0.65-1.377,0.65
c-0.445,0-0.805-0.143-1.076-0.427c-0.246-0.258-0.369-0.579-0.369-0.96c0-0.576,0.24-1.015,0.723-1.319
c0.482-0.304,1.16-0.453,2.033-0.446V10.3c0-0.621-0.326-0.931-0.979-0.931c-0.465,0-0.875,0.117-1.229,0.349l-0.213-0.688
c0.438-0.271,0.979-0.407,1.617-0.407c1.232,0,1.85,0.65,1.85,1.95v1.736C82.262,12.78,82.285,13.155,82.33,13.433z
M81.242,11.813v-0.727c-1.156-0.02-1.734,0.297-1.734,0.95c0,0.246,0.066,0.43,0.201,0.553c0.135,0.123,0.307,0.184,0.512,0.184
c0.23,0,0.445-0.073,0.641-0.218c0.197-0.146,0.318-0.331,0.363-0.558C81.236,11.946,81.242,11.884,81.242,11.813z"/>
<path fill="#FFFFFF" d="M88.285,13.433h-0.93l-0.049-0.757h-0.029c-0.297,0.576-0.803,0.864-1.514,0.864
c-0.568,0-1.041-0.223-1.416-0.669s-0.562-1.025-0.562-1.736c0-0.763,0.203-1.381,0.611-1.853c0.395-0.44,0.879-0.66,1.455-0.66
c0.633,0,1.076,0.213,1.328,0.64h0.02V6.556h1.049v5.607C88.248,12.622,88.26,13.045,88.285,13.433z M87.199,11.445v-0.786
c0-0.136-0.01-0.246-0.029-0.33c-0.059-0.252-0.186-0.464-0.379-0.635c-0.195-0.171-0.43-0.257-0.701-0.257
c-0.391,0-0.697,0.155-0.922,0.466c-0.223,0.311-0.336,0.708-0.336,1.193c0,0.466,0.107,0.844,0.322,1.135
c0.227,0.31,0.533,0.465,0.916,0.465c0.344,0,0.619-0.129,0.828-0.388C87.1,12.069,87.199,11.781,87.199,11.445z"/>
<path fill="#FFFFFF" d="M97.248,11.037c0,0.725-0.207,1.319-0.621,1.785c-0.434,0.479-1.008,0.718-1.727,0.718
c-0.691,0-1.242-0.229-1.654-0.689c-0.41-0.459-0.615-1.038-0.615-1.736c0-0.73,0.211-1.329,0.635-1.794s0.994-0.698,1.713-0.698
c0.691,0,1.248,0.229,1.668,0.688C97.047,9.757,97.248,10.333,97.248,11.037z M96.162,11.071c0-0.435-0.094-0.808-0.281-1.119
c-0.221-0.376-0.533-0.564-0.941-0.564c-0.42,0-0.74,0.188-0.961,0.564c-0.188,0.311-0.281,0.69-0.281,1.138
c0,0.435,0.094,0.808,0.281,1.119c0.227,0.376,0.543,0.564,0.951,0.564c0.4,0,0.715-0.191,0.941-0.574
C96.064,11.882,96.162,11.506,96.162,11.071z"/>
<path fill="#FFFFFF" d="M102.883,13.433h-1.047v-2.7c0-0.832-0.316-1.248-0.951-1.248c-0.311,0-0.562,0.114-0.756,0.343
s-0.291,0.499-0.291,0.808v2.796h-1.049v-3.366c0-0.414-0.012-0.863-0.037-1.349h0.92l0.049,0.737h0.029
c0.123-0.229,0.305-0.418,0.543-0.569c0.285-0.176,0.602-0.265,0.951-0.265c0.439,0,0.805,0.142,1.096,0.427
c0.363,0.349,0.543,0.87,0.543,1.562V13.433z"/>
<path fill="#FFFFFF" d="M109.936,9.504h-1.154v2.29c0,0.582,0.205,0.873,0.611,0.873c0.188,0,0.344-0.016,0.467-0.049
l0.027,0.795c-0.207,0.078-0.479,0.117-0.814,0.117c-0.414,0-0.736-0.126-0.969-0.378c-0.234-0.252-0.35-0.676-0.35-1.271V9.504
h-0.689V8.719h0.689V7.855l1.027-0.31v1.173h1.154V9.504z"/>
<path fill="#FFFFFF" d="M115.484,13.433h-1.049v-2.68c0-0.845-0.316-1.268-0.949-1.268c-0.486,0-0.818,0.245-1,0.735
c-0.031,0.103-0.049,0.229-0.049,0.377v2.835h-1.047V6.556h1.047v2.841h0.02c0.33-0.517,0.803-0.775,1.416-0.775
c0.434,0,0.793,0.142,1.078,0.427c0.355,0.355,0.533,0.883,0.533,1.581V13.433z"/>
<path fill="#FFFFFF" d="M121.207,10.853c0,0.188-0.014,0.346-0.039,0.475h-3.143c0.014,0.466,0.164,0.821,0.455,1.067
c0.266,0.22,0.609,0.33,1.029,0.33c0.465,0,0.889-0.074,1.271-0.223l0.164,0.728c-0.447,0.194-0.973,0.291-1.582,0.291
c-0.73,0-1.305-0.215-1.721-0.645c-0.418-0.43-0.625-1.007-0.625-1.731c0-0.711,0.193-1.303,0.582-1.775
c0.406-0.504,0.955-0.756,1.648-0.756c0.678,0,1.193,0.252,1.541,0.756C121.068,9.77,121.207,10.265,121.207,10.853z
M120.207,10.582c0.008-0.311-0.061-0.579-0.203-0.805c-0.182-0.291-0.459-0.437-0.834-0.437c-0.342,0-0.621,0.142-0.834,0.427
c-0.174,0.227-0.277,0.498-0.311,0.815H120.207z"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 286.054 286.054" style="enable-background:new 0 0 286.054 286.054;" xml:space="preserve">
<g>
<path style="fill:#E2574C;" d="M168.352,142.924l25.28-25.28c3.495-3.504,3.495-9.154,0-12.64l-12.64-12.649
c-3.495-3.486-9.145-3.495-12.64,0l-25.289,25.289l-25.271-25.271c-3.504-3.504-9.163-3.504-12.658-0.018l-12.64,12.649
c-3.495,3.486-3.486,9.154,0.018,12.649l25.271,25.271L92.556,168.15c-3.495,3.495-3.495,9.145,0,12.64l12.64,12.649
c3.495,3.486,9.145,3.495,12.64,0l25.226-25.226l25.405,25.414c3.504,3.504,9.163,3.504,12.658,0.009l12.64-12.64
c3.495-3.495,3.486-9.154-0.009-12.658L168.352,142.924z M143.027,0.004C64.031,0.004,0,64.036,0,143.022
c0,78.996,64.031,143.027,143.027,143.027s143.027-64.031,143.027-143.027C286.054,64.045,222.022,0.004,143.027,0.004z
M143.027,259.232c-64.183,0-116.209-52.026-116.209-116.209s52.026-116.21,116.209-116.21s116.209,52.026,116.209,116.209
S207.21,259.232,143.027,259.232z"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,429 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
xml:space="preserve"
width="135.71649"
height="40.018951"
viewBox="0 0 135.71649 40.018951"
sodipodi:docname="google-play-badge.svg"><metadata
id="metadata8"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs6"><linearGradient
x1="31.7997"
y1="183.2903"
x2="15.0173"
y2="166.5079"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8,0,0,-0.8,0,161.6)"
spreadMethod="pad"
id="linearGradient50"><stop
style="stop-opacity:1;stop-color:#00a0ff"
offset="0"
id="stop52" /><stop
style="stop-opacity:1;stop-color:#00a1ff"
offset="0.0066"
id="stop54" /><stop
style="stop-opacity:1;stop-color:#00beff"
offset="0.2601"
id="stop56" /><stop
style="stop-opacity:1;stop-color:#00d2ff"
offset="0.5122"
id="stop58" /><stop
style="stop-opacity:1;stop-color:#00dfff"
offset="0.7604"
id="stop60" /><stop
style="stop-opacity:1;stop-color:#00e3ff"
offset="1"
id="stop62" /></linearGradient><linearGradient
x1="43.8344"
y1="171.9986"
x2="19.637501"
y2="171.9986"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8,0,0,-0.8,0,161.6)"
spreadMethod="pad"
id="linearGradient68"><stop
style="stop-opacity:1;stop-color:#ffe000"
offset="0"
id="stop70" /><stop
style="stop-opacity:1;stop-color:#ffbd00"
offset="0.4087"
id="stop72" /><stop
style="stop-opacity:1;stop-color:#ffa500"
offset="0.7754"
id="stop74" /><stop
style="stop-opacity:1;stop-color:#ff9c00"
offset="1"
id="stop76" /></linearGradient><linearGradient
x1="34.827"
y1="169.7039"
x2="12.0687"
y2="146.9456"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8,0,0,-0.8,0,161.6)"
spreadMethod="pad"
id="linearGradient82"><stop
style="stop-opacity:1;stop-color:#ff3a44"
offset="0"
id="stop84" /><stop
style="stop-opacity:1;stop-color:#c31162"
offset="1"
id="stop86" /></linearGradient><linearGradient
x1="17.2973"
y1="191.82381"
x2="27.4599"
y2="181.6613"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8,0,0,-0.8,0,161.6)"
spreadMethod="pad"
id="linearGradient92"><stop
style="stop-opacity:1;stop-color:#32a071"
offset="0"
id="stop94" /><stop
style="stop-opacity:1;stop-color:#2da771"
offset="0.0685"
id="stop96" /><stop
style="stop-opacity:1;stop-color:#15cf74"
offset="0.4762"
id="stop98" /><stop
style="stop-opacity:1;stop-color:#06e775"
offset="0.8009"
id="stop100" /><stop
style="stop-opacity:1;stop-color:#00f076"
offset="1"
id="stop102" /></linearGradient><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath110"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path112"
inkscape:connector-curvature="0" /></clipPath><mask
maskUnits="userSpaceOnUse"
x="0"
y="0"
width="1"
height="1"
id="mask114"><g
id="g116"><g
clip-path="url(#clipPath110)"
id="g118"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
style="fill:#000000;fill-opacity:0.2;fill-rule:nonzero;stroke:none"
id="path120"
inkscape:connector-curvature="0" /></g></g></mask><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath126"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path128"
inkscape:connector-curvature="0" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath130"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path132"
inkscape:connector-curvature="0" /></clipPath><pattern
patternTransform="matrix(1,0,0,-1,0,48)"
patternUnits="userSpaceOnUse"
x="0"
y="0"
width="124"
height="48"
id="pattern134"><g
id="g136" /><g
id="g138"><g
clip-path="url(#clipPath130)"
id="g140"><g
id="g142"><path
d="M 29.625,20.695 18.012,14.098 C 17.363,13.727 16.781,13.754 16.406,14.09 l -0.058,-0.063 0.058,-0.058 c 0.375,-0.336 0.957,-0.36 1.606,0.011 l 11.687,6.641 -0.074,0.074 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path144" /></g></g></g></pattern><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath158"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path160"
inkscape:connector-curvature="0" /></clipPath><mask
maskUnits="userSpaceOnUse"
x="0"
y="0"
width="1"
height="1"
id="mask162"><g
id="g164"><g
clip-path="url(#clipPath158)"
id="g166"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
style="fill:#000000;fill-opacity:0.12000002;fill-rule:nonzero;stroke:none"
id="path168"
inkscape:connector-curvature="0" /></g></g></mask><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath174"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path176"
inkscape:connector-curvature="0" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath178"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path180"
inkscape:connector-curvature="0" /></clipPath><pattern
patternTransform="matrix(1,0,0,-1,0,48)"
patternUnits="userSpaceOnUse"
x="0"
y="0"
width="124"
height="48"
id="pattern182"><g
id="g184" /><g
id="g186"><g
clip-path="url(#clipPath178)"
id="g188"><g
id="g190"><path
d="m 16.348,14.145 c -0.235,0.246 -0.371,0.628 -0.371,1.125 l 0,-0.118 c 0,-0.496 0.136,-0.879 0.371,-1.125 l 0.058,0.063 -0.058,0.055 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path192" /></g></g></g></pattern><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath206"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path208"
inkscape:connector-curvature="0" /></clipPath><mask
maskUnits="userSpaceOnUse"
x="0"
y="0"
width="1"
height="1"
id="mask210"><g
id="g212"><g
clip-path="url(#clipPath206)"
id="g214"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
style="fill:#000000;fill-opacity:0.12000002;fill-rule:nonzero;stroke:none"
id="path216"
inkscape:connector-curvature="0" /></g></g></mask><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath222"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path224"
inkscape:connector-curvature="0" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath226"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path228"
inkscape:connector-curvature="0" /></clipPath><pattern
patternTransform="matrix(1,0,0,-1,0,48)"
patternUnits="userSpaceOnUse"
x="0"
y="0"
width="124"
height="48"
id="pattern230"><g
id="g232" /><g
id="g234"><g
clip-path="url(#clipPath226)"
id="g236"><g
id="g238"><path
d="m 33.613,22.961 -3.988,-2.266 0.074,-0.074 3.914,2.223 c 0.559,0.316 0.836,0.734 0.836,1.156 -0.047,-0.379 -0.332,-0.75 -0.836,-1.039 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path240" /></g></g></g></pattern><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath254"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path256"
inkscape:connector-curvature="0" /></clipPath><mask
maskUnits="userSpaceOnUse"
x="0"
y="0"
width="1"
height="1"
id="mask258"><g
id="g260"><g
clip-path="url(#clipPath254)"
id="g262"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
style="fill:#000000;fill-opacity:0.25;fill-rule:nonzero;stroke:none"
id="path264"
inkscape:connector-curvature="0" /></g></g></mask><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath270"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path272"
inkscape:connector-curvature="0" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath274"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
id="path276"
inkscape:connector-curvature="0" /></clipPath><pattern
patternTransform="matrix(1,0,0,-1,0,48)"
patternUnits="userSpaceOnUse"
x="0"
y="0"
width="124"
height="48"
id="pattern278"><g
id="g280" /><g
id="g282"><g
clip-path="url(#clipPath274)"
id="g284"><g
id="g286"><path
d="m 18.012,33.902 15.601,-8.863 c 0.508,-0.289 0.789,-0.66 0.836,-1.039 0,0.418 -0.277,0.836 -0.836,1.156 L 18.012,34.02 c -1.117,0.632 -2.035,0.105 -2.035,-1.176 l 0,-0.114 c 0,1.278 0.918,1.805 2.035,1.172 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path288" /></g></g></g></pattern></defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview4"
showgrid="false"
inkscape:zoom="7.6276974"
inkscape:cx="93.965168"
inkscape:cy="29.61582"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="g10" /><g
id="g10"
inkscape:groupmode="layer"
inkscape:label="google-play-badge"
transform="matrix(1.25,0,0,-1.25,-9.4247625,49.85025)"><g
id="g12"
transform="matrix(1.0023923,0,0,0.99072975,-0.29664807,0)"><path
d="M 112,8 12,8 C 9.801,8 8,9.801 8,12 l 0,24 c 0,2.199 1.801,4 4,4 l 100,0 c 2.199,0 4,-1.801 4,-4 l 0,-24 c 0,-2.199 -1.801,-4 -4,-4 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path14"
inkscape:connector-curvature="0" /><path
d="m 112,39.359 c 1.852,0 3.359,-1.507 3.359,-3.359 l 0,-24 c 0,-1.852 -1.507,-3.359 -3.359,-3.359 l -100,0 c -1.852,0 -3.359,1.507 -3.359,3.359 l 0,24 c 0,1.852 1.507,3.359 3.359,3.359 l 100,0 M 112,40 12,40 C 9.801,40 8,38.199 8,36 L 8,12 C 8,9.801 9.801,8 12,8 l 100,0 c 2.199,0 4,1.801 4,4 l 0,24 c 0,2.199 -1.801,4 -4,4 z"
style="fill:#a6a6a6;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path16"
inkscape:connector-curvature="0" /><g
id="g18"
transform="matrix(1,0,0,-1,0,48)"><path
d="m 45.934,16.195 c 0,0.668 -0.2,1.203 -0.594,1.602 -0.453,0.473 -1.043,0.711 -1.766,0.711 -0.691,0 -1.281,-0.242 -1.765,-0.719 -0.485,-0.484 -0.727,-1.078 -0.727,-1.789 0,-0.711 0.242,-1.305 0.727,-1.785 0.484,-0.481 1.074,-0.723 1.765,-0.723 0.344,0 0.672,0.071 0.985,0.203 0.312,0.133 0.566,0.313 0.75,0.535 l -0.418,0.422 c -0.321,-0.379 -0.758,-0.566 -1.317,-0.566 -0.504,0 -0.941,0.176 -1.312,0.531 -0.367,0.356 -0.551,0.817 -0.551,1.383 0,0.566 0.184,1.031 0.551,1.387 0.371,0.351 0.808,0.531 1.312,0.531 0.535,0 0.985,-0.18 1.34,-0.535 0.234,-0.235 0.367,-0.559 0.402,-0.973 l -1.742,0 0,-0.578 2.324,0 c 0.028,0.125 0.036,0.246 0.036,0.363 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
id="path20"
inkscape:connector-curvature="0" /></g><g
id="g22"
transform="matrix(1,0,0,-1,0,48)"><path
d="m 49.621,14.191 -2.183,0 0,1.52 1.968,0 0,0.578 -1.968,0 0,1.52 2.183,0 0,0.589 -2.801,0 0,-4.796 2.801,0 0,0.589 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
id="path24"
inkscape:connector-curvature="0" /></g><g
id="g26"
transform="matrix(1,0,0,-1,0,48)"><path
d="m 52.223,18.398 -0.618,0 0,-4.207 -1.339,0 0,-0.589 3.297,0 0,0.589 -1.34,0 0,4.207 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
id="path28"
inkscape:connector-curvature="0" /></g><g
id="g30"
transform="matrix(1,0,0,-1,0,48)"><path
d="m 55.949,18.398 0,-4.796 0.617,0 0,4.796 -0.617,0 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
id="path32"
inkscape:connector-curvature="0" /></g><g
id="g34"
transform="matrix(1,0,0,-1,0,48)"><path
d="m 59.301,18.398 -0.613,0 0,-4.207 -1.344,0 0,-0.589 3.301,0 0,0.589 -1.344,0 0,4.207 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
id="path36"
inkscape:connector-curvature="0" /></g><g
id="g38"
transform="matrix(1,0,0,-1,0,48)"><path
d="m 66.887,17.781 c -0.473,0.485 -1.059,0.727 -1.758,0.727 -0.703,0 -1.289,-0.242 -1.762,-0.727 C 62.895,17.297 62.66,16.703 62.66,16 c 0,-0.703 0.235,-1.297 0.707,-1.781 0.473,-0.485 1.059,-0.727 1.762,-0.727 0.695,0 1.281,0.242 1.754,0.731 0.476,0.488 0.711,1.078 0.711,1.777 0,0.703 -0.235,1.297 -0.707,1.781 z m -3.063,-0.402 c 0.356,0.359 0.789,0.539 1.305,0.539 0.512,0 0.949,-0.18 1.301,-0.539 0.355,-0.359 0.535,-0.82 0.535,-1.379 0,-0.559 -0.18,-1.02 -0.535,-1.379 -0.352,-0.359 -0.789,-0.539 -1.301,-0.539 -0.516,0 -0.949,0.18 -1.305,0.539 -0.355,0.359 -0.535,0.82 -0.535,1.379 0,0.559 0.18,1.02 0.535,1.379 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
id="path40"
inkscape:connector-curvature="0" /></g><g
id="g42"
transform="matrix(1,0,0,-1,0,48)"><path
d="m 68.461,18.398 0,-4.796 0.75,0 2.332,3.73 0.027,0 -0.027,-0.922 0,-2.808 0.617,0 0,4.796 -0.644,0 -2.442,-3.914 -0.027,0 0.027,0.926 0,2.988 -0.613,0 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
id="path44"
inkscape:connector-curvature="0" /></g><path
d="m 62.508,22.598 c -1.879,0 -3.414,-1.43 -3.414,-3.403 0,-1.957 1.535,-3.402 3.414,-3.402 1.883,0 3.418,1.445 3.418,3.402 0,1.973 -1.535,3.403 -3.418,3.403 z m 0,-5.465 c -1.031,0 -1.918,0.851 -1.918,2.062 0,1.227 0.887,2.063 1.918,2.063 1.031,0 1.922,-0.836 1.922,-2.063 0,-1.211 -0.891,-2.062 -1.922,-2.062 z m -7.449,5.465 c -1.883,0 -3.414,-1.43 -3.414,-3.403 0,-1.957 1.531,-3.402 3.414,-3.402 1.882,0 3.414,1.445 3.414,3.402 0,1.973 -1.532,3.403 -3.414,3.403 z m 0,-5.465 c -1.032,0 -1.922,0.851 -1.922,2.062 0,1.227 0.89,2.063 1.922,2.063 1.031,0 1.918,-0.836 1.918,-2.063 0,-1.211 -0.887,-2.062 -1.918,-2.062 z m -8.864,4.422 0,-1.446 3.453,0 c -0.101,-0.808 -0.371,-1.402 -0.785,-1.816 -0.504,-0.5 -1.289,-1.055 -2.668,-1.055 -2.125,0 -3.789,1.715 -3.789,3.84 0,2.125 1.664,3.84 3.789,3.84 1.149,0 1.985,-0.449 2.602,-1.031 l 1.019,1.019 c -0.863,0.824 -2.011,1.457 -3.621,1.457 -2.914,0 -5.363,-2.371 -5.363,-5.285 0,-2.914 2.449,-5.285 5.363,-5.285 1.575,0 2.758,0.516 3.688,1.484 0.953,0.953 1.25,2.293 1.25,3.375 0,0.336 -0.028,0.645 -0.078,0.903 l -4.86,0 z m 36.246,-1.121 c -0.281,0.761 -1.148,2.164 -2.914,2.164 -1.75,0 -3.207,-1.379 -3.207,-3.403 0,-1.906 1.442,-3.402 3.375,-3.402 1.563,0 2.465,0.953 2.836,1.508 l -1.16,0.773 c -0.387,-0.566 -0.914,-0.941 -1.676,-0.941 -0.757,0 -1.3,0.347 -1.648,1.031 l 4.551,1.883 -0.157,0.387 z m -4.64,-1.133 c -0.039,1.312 1.019,1.984 1.777,1.984 0.594,0 1.098,-0.297 1.266,-0.722 L 77.801,19.301 Z M 74.102,16 l 1.496,0 0,10 -1.496,0 0,-10 z m -2.45,5.84 -0.05,0 c -0.336,0.398 -0.977,0.758 -1.789,0.758 -1.704,0 -3.262,-1.496 -3.262,-3.414 0,-1.907 1.558,-3.391 3.262,-3.391 0.812,0 1.453,0.363 1.789,0.773 l 0.05,0 0,-0.488 c 0,-1.301 -0.695,-2 -1.816,-2 -0.914,0 -1.481,0.66 -1.715,1.215 L 66.82,14.75 c 0.375,-0.902 1.368,-2.012 3.016,-2.012 1.754,0 3.234,1.032 3.234,3.543 l 0,6.11 -1.418,0 0,-0.551 z m -1.711,-4.707 c -1.031,0 -1.894,0.863 -1.894,2.051 0,1.199 0.863,2.074 1.894,2.074 1.016,0 1.817,-0.875 1.817,-2.074 0,-1.188 -0.801,-2.051 -1.817,-2.051 z M 89.445,26 l -3.578,0 0,-10 1.492,0 0,3.789 2.086,0 c 1.657,0 3.282,1.199 3.282,3.106 0,1.906 -1.629,3.105 -3.282,3.105 z m 0.039,-4.82 -2.125,0 0,3.429 2.125,0 c 1.114,0 1.75,-0.925 1.75,-1.714 0,-0.774 -0.636,-1.715 -1.75,-1.715 z m 9.223,1.437 c -1.078,0 -2.199,-0.476 -2.66,-1.531 l 1.324,-0.555 c 0.285,0.555 0.809,0.735 1.363,0.735 0.774,0 1.559,-0.465 1.571,-1.286 l 0,-0.105 c -0.27,0.156 -0.848,0.387 -1.559,0.387 -1.426,0 -2.879,-0.785 -2.879,-2.25 0,-1.34 1.168,-2.203 2.481,-2.203 1.004,0 1.558,0.453 1.906,0.98 l 0.051,0 0,-0.773 1.441,0 0,3.836 c 0,1.773 -1.324,2.765 -3.039,2.765 z m -0.18,-5.48 c -0.488,0 -1.168,0.242 -1.168,0.847 0,0.774 0.848,1.071 1.582,1.071 0.657,0 0.965,-0.145 1.364,-0.336 -0.117,-0.926 -0.914,-1.582 -1.778,-1.582 z m 8.469,5.261 -1.715,-4.335 -0.051,0 -1.773,4.335 -1.609,0 2.664,-6.058 -1.52,-3.371 1.559,0 4.105,9.429 -1.66,0 z M 93.547,16 l 1.496,0 0,10 -1.496,0 0,-10 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path46"
inkscape:connector-curvature="0" /><g
id="g48"><path
d="M 16.348,33.969 C 16.113,33.723 15.977,33.34 15.977,32.844 l 0,-17.692 c 0,-0.496 0.136,-0.879 0.371,-1.125 l 0.058,-0.054 9.914,9.91 0,0.234 -9.914,9.91 -0.058,-0.058 z"
style="fill:url(#linearGradient50);fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path64"
inkscape:connector-curvature="0" /></g><g
id="g66"><path
d="m 29.621,20.578 -3.301,3.305 0,0.234 3.305,3.305 0.074,-0.043 3.914,-2.227 c 1.117,-0.632 1.117,-1.672 0,-2.308 l -3.914,-2.223 -0.078,-0.043 z"
style="fill:url(#linearGradient68);fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path78"
inkscape:connector-curvature="0" /></g><g
id="g80"><path
d="M 29.699,20.621 26.32,24 16.348,14.027 c 0.371,-0.39 0.976,-0.437 1.664,-0.047 l 11.687,6.641"
style="fill:url(#linearGradient82);fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path88"
inkscape:connector-curvature="0" /></g><g
id="g90"><path
d="M 29.699,27.379 18.012,34.02 c -0.688,0.386 -1.293,0.339 -1.664,-0.051 L 26.32,24 l 3.379,3.379 z"
style="fill:url(#linearGradient92);fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path104"
inkscape:connector-curvature="0" /></g><g
id="g106"><g
id="g108" /><g
id="g122"
mask="url(#mask114)"><g
id="g124" /><g
id="g146"><g
clip-path="url(#clipPath126)"
id="g148"><g
id="g150"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
style="fill:url(#pattern134);fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path152"
inkscape:connector-curvature="0" /></g></g></g></g></g><g
id="g154"><g
id="g156" /><g
id="g170"
mask="url(#mask162)"><g
id="g172" /><g
id="g194"><g
clip-path="url(#clipPath174)"
id="g196"><g
id="g198"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
style="fill:url(#pattern182);fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path200"
inkscape:connector-curvature="0" /></g></g></g></g></g><g
id="g202"><g
id="g204" /><g
id="g218"
mask="url(#mask210)"><g
id="g220" /><g
id="g242"><g
clip-path="url(#clipPath222)"
id="g244"><g
id="g246"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
style="fill:url(#pattern230);fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path248"
inkscape:connector-curvature="0" /></g></g></g></g></g><g
id="g250"><g
id="g252" /><g
id="g266"
mask="url(#mask258)"><g
id="g268" /><g
id="g290"><g
clip-path="url(#clipPath270)"
id="g292"><g
id="g294"><path
d="M 0,0 124,0 124,48 0,48 0,0 Z"
style="fill:url(#pattern278);fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path296"
inkscape:connector-curvature="0" /></g></g></g></g></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 55 55" style="enable-background:new 0 0 55 55;" xml:space="preserve">
<path d="M55,27.5C55,12.337,42.663,0,27.5,0S0,12.337,0,27.5c0,8.009,3.444,15.228,8.926,20.258l-0.026,0.023l0.892,0.752
c0.058,0.049,0.121,0.089,0.179,0.137c0.474,0.393,0.965,0.766,1.465,1.127c0.162,0.117,0.324,0.234,0.489,0.348
c0.534,0.368,1.082,0.717,1.642,1.048c0.122,0.072,0.245,0.142,0.368,0.212c0.613,0.349,1.239,0.678,1.88,0.98
c0.047,0.022,0.095,0.042,0.142,0.064c2.089,0.971,4.319,1.684,6.651,2.105c0.061,0.011,0.122,0.022,0.184,0.033
c0.724,0.125,1.456,0.225,2.197,0.292c0.09,0.008,0.18,0.013,0.271,0.021C25.998,54.961,26.744,55,27.5,55
c0.749,0,1.488-0.039,2.222-0.098c0.093-0.008,0.186-0.013,0.279-0.021c0.735-0.067,1.461-0.164,2.178-0.287
c0.062-0.011,0.125-0.022,0.187-0.034c2.297-0.412,4.495-1.109,6.557-2.055c0.076-0.035,0.153-0.068,0.229-0.104
c0.617-0.29,1.22-0.603,1.811-0.936c0.147-0.083,0.293-0.167,0.439-0.253c0.538-0.317,1.067-0.648,1.581-1
c0.185-0.126,0.366-0.259,0.549-0.391c0.439-0.316,0.87-0.642,1.289-0.983c0.093-0.075,0.193-0.14,0.284-0.217l0.915-0.764
l-0.027-0.023C51.523,42.802,55,35.55,55,27.5z M2,27.5C2,13.439,13.439,2,27.5,2S53,13.439,53,27.5
c0,7.577-3.325,14.389-8.589,19.063c-0.294-0.203-0.59-0.385-0.893-0.537l-8.467-4.233c-0.76-0.38-1.232-1.144-1.232-1.993v-2.957
c0.196-0.242,0.403-0.516,0.617-0.817c1.096-1.548,1.975-3.27,2.616-5.123c1.267-0.602,2.085-1.864,2.085-3.289v-3.545
c0-0.867-0.318-1.708-0.887-2.369v-4.667c0.052-0.52,0.236-3.448-1.883-5.864C34.524,9.065,31.541,8,27.5,8
s-7.024,1.065-8.867,3.168c-2.119,2.416-1.935,5.346-1.883,5.864v4.667c-0.568,0.661-0.887,1.502-0.887,2.369v3.545
c0,1.101,0.494,2.128,1.34,2.821c0.81,3.173,2.477,5.575,3.093,6.389v2.894c0,0.816-0.445,1.566-1.162,1.958l-7.907,4.313
c-0.252,0.137-0.502,0.297-0.752,0.476C5.276,41.792,2,35.022,2,27.5z"/>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1,2 +0,0 @@
$theme-spacing: 10px;

View File

@ -1,24 +0,0 @@
@import '../../variables.scss';
.container {
text-align: center;
}
.messageContainer {
color: green;
.username {
display: block;
font-size: 1.6em;
font-weight: bold;
}
}
.statusIcon {
margin-top: ($theme-spacing) * 2;
margin-bottom: ($theme-spacing) * 2;
}
.logoutButtonContainer {
margin-top: ($theme-spacing) * 2,
}

View File

@ -1,148 +0,0 @@
$brand-success: #5cb85c;
$brand-failure: #d44141;
$loader-size: 4em;
$check-height: $loader-size/2;
$check-width: $check-height/2;
$check-left: ($loader-size/6 + $loader-size/25);
$check-thickness: 3px;
$check-color: $brand-success;
$cross-height: $loader-size/2;
$cross-width: $check-height/10 - $check-height/12;
$cross-left: $loader-size/2;
$cross-top: $loader-size/4;
.circleLoader {
border: 1px solid rgba(0, 0, 0, 0.2);
border-left-color: $check-color;
animation: loader-spin 1.2s infinite linear;
position: relative;
display: inline-block;
vertical-align: top;
border-radius: 50%;
width: $loader-size;
height: $loader-size;
}
.loadComplete {
-webkit-animation: none;
animation: none;
transition: border 500ms ease-out;
&.success {
border-color: $brand-success;
}
&.failure {
border-color: $brand-failure;
}
}
.checkmark {
display: none;
&.show {
display: inline;
}
&.draw:after {
animation-duration: 800ms;
animation-timing-function: ease;
animation-name: checkmark;
transform: scaleX(-1) rotate(135deg);
}
&:after {
opacity: 1;
height: $check-height;
width: $check-width;
transform-origin: left top;
border-right: $check-thickness solid $check-color;
border-top: $check-thickness solid $check-color;
content: '';
left: $check-left;
top: $check-height;
position: absolute;
}
}
.cross {
display: none;
&.show {
display: inline;
}
&.draw:after, &.draw:before {
animation-duration: 300ms;
animation-timing-function: ease;
animation-name: cross;
}
&:before, &:after {
position: absolute;
left: $cross-left;
top: $cross-top;
content: '';
height: $cross-height;
width: $cross-width;
background-color: $brand-failure;
}
&:before {
transform: rotate(45deg);
}
&:after {
transform: rotate(-45deg);
}
}
@keyframes loader-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes checkmark {
0% {
height: 0;
width: 0;
opacity: 1;
}
20% {
height: 0;
width: $check-width;
opacity: 1;
}
40% {
height: $check-height;
width: $check-width;
opacity: 1;
}
100% {
height: $check-height;
width: $check-width;
opacity: 1;
}
}
@keyframes cross {
0% {
width: 0;
height: 0;
}
20% {
height: 0;
width: $cross-width;
}
40% {
height: $cross-height;
width: $cross-width;
}
100% {
width: $cross-width;
height: $cross-height;
}
}

View File

@ -1,43 +0,0 @@
@import '../../variables.scss';
.notification {
margin-bottom: ($theme-spacing) * 2;
}
.field {
padding-bottom: ($theme-spacing) * 2;
}
.input {
width: 100%;
}
.buttons button{
width: 100%;
}
.controls {
display: inline-block;
width: 100%;
font-size: 0.875rem;
}
.rememberMe {
float: left;
font-size: 0.8em;
display: flex;
align-items: center;
margin-left: -11px;
}
.resetPassword {
height: 40px;
float: right;
display: flex;
align-items: center;
}
.resetPassword a {
color: black;
font-size: 0.8em;
}

View File

@ -1,10 +0,0 @@
@import '../../variables.scss';
.container {
color: white;
font-size: 0.8em;
padding: ($theme-spacing) * 2;
border: 1px solid red;
border-radius: 5px;
background-color: #ff8d8d;
}

View File

@ -1,15 +0,0 @@
@import '../../variables.scss';
.image {
width: '120px';
}
.imageContainer {
text-align: center;
margin-top: ($theme-spacing) * 2;
margin-bottom: ($theme-spacing) * 2;
}
.retryContainer {
text-align: center;
}

View File

@ -1,52 +0,0 @@
@import '../../variables.scss';
.container {
position: relative,
}
.header {
font-size: 1.5em;
margin-bottom: ($theme-spacing);
position: relative;
.hello {
display: inline-block;
}
.logout {
position: absolute;
bottom: 0px;
right: 0px;
font-size: 0.6em,
}
}
.body {
padding-top: ($theme-spacing) * 2;
padding-bottom: ($theme-spacing) * 2;
padding-left: ($theme-spacing) * 2;
padding-right: ($theme-spacing) * 2;
margin: (($theme-spacing) * 2) 0px;
border: 1px solid #e0e0e0;
border-radius: 2px;
}
.methodName {
font-size: 1.2em;
font-weight: bold;
margin-bottom: ($theme-spacing);
}
.anotherMethodLink {
text-align: center;
font-size: (0.8em)
}
.buttonsContainer {
text-align: center;
margin: ($theme-spacing) 0;
button {
margin: ($theme-spacing) 0;
}
}

View File

@ -1,20 +0,0 @@
@import '../../variables.scss';
.totpField {
margin-top: ($theme-spacing) * 2;
width: 100%;
}
.totpButton {
margin-top: ($theme-spacing);
button {
width: 100%;
}
}
.registerDeviceContainer {
text-align: right;
font-size: 0.7em;
}

View File

@ -1,21 +0,0 @@
@import '../../variables.scss';
.methodU2f {
padding: ($theme-spacing);
}
.image {
width: '120px';
}
.imageContainer {
text-align: center;
margin-top: ($theme-spacing) * 2;
margin-bottom: ($theme-spacing) * 2;
}
.registerDeviceContainer {
text-align: right;
font-size: 0.7em;
}

View File

@ -1,40 +0,0 @@
@import '../../variables.scss';
@import "@material/theme/mdc-theme";
.mainContent {
width: 440px;
margin: auto;
margin-top: 80px;
}
.title {
font-size: 1.4em;
font-weight: bold;
display: inline-block;
padding-bottom: ($theme-spacing);
}
.frame {
box-shadow:
rgba(0,0,0,0.14902) 0px 1px 1px 0px,
rgba(0,0,0,0.09804) 0px 1px 2px 0px;
background-color: white;
border-radius: 5px;
padding: 40px;
border-top: 6px solid ($mdc-theme-primary);
}
.innerFrame {
width: 100%;
}
.footer {
margin-top: 10px;
text-align: center;
font-size: 0.65em;
color: grey;
a:visited {
color: grey;
}
}

View File

@ -1,26 +0,0 @@
.image {
width: 100%;
display: inline-block
}
.image img {
width: 64px;
display: block;
}
.left {
width: 24%;
display: inline-block;
}
.right {
width: 76%;
display: inline-block;
vertical-align: top;
}
.buttonContainer {
padding-top: 20px;
}

View File

@ -1,36 +0,0 @@
@import '../../variables.scss';
.form {
padding-top: ($theme-spacing) * 2;
}
.field {
width: 100%;
}
.buttonsContainer {
margin-top: ($theme-spacing) * 2;
width: 100%;
}
.buttonContainer {
width: 50%;
display: inline-block;
box-sizing: border-box;
}
.buttonConfirmContainer {
padding-right: ($theme-spacing) / 2;
}
.buttonConfirm {
width: 100%;
}
.buttonCancelContainer {
padding-left: ($theme-spacing) / 2;
}
.buttonCancel {
width: 100%;
}

View File

@ -1,64 +0,0 @@
@import '../../variables.scss';
.secretContainer {
width: 100%;
border: 1px solid #dcdcdc;
border-radius: 10px;
margin-top: ($theme-spacing) * 2;
margin-bottom: ($theme-spacing) * 2;
}
.qrcodeContainer {
text-align: center;
padding: ($theme-spacing) * 2;
}
.base32Container {
text-align: center;
border-top: 1px solid #dcdcdc;
padding: ($theme-spacing);
word-wrap: break-word;
}
.otpauthContainer {
display: none;
}
.text {
text-align: center;
}
.needGoogleAuthenticator {
text-align: center;
margin-top: ($theme-spacing) * 2;
}
.needGoogleAuthenticatorText {
font-size: 0.8em;
}
.store {
width: 100px;
margin-top: ($theme-spacing) * 0.5;
margin-left: ($theme-spacing) * 0.5;
margin-right: ($theme-spacing) * 0.5;
}
.buttonContainer {
text-align: center;
padding-top: ($theme-spacing) * 2;
}
.progressContainer {
text-align: center;
padding-top: ($theme-spacing) * 2,
}
.button {
margin-left: ($theme-spacing);
margin-right: ($theme-spacing);
}
.loginButtonContainer {
text-align: center;
}

View File

@ -1,32 +0,0 @@
@import '../../variables.scss';
.form {
margin-top: ($theme-spacing) * 2,
}
.field {
width: 100%;
margin-bottom: ($theme-spacing) * 2;
}
.buttonsContainer {
width: 100%;
}
.buttonContainer {
width: 50%;
box-sizing: border-box;
display: inline-block;
}
.buttonResetContainer {
padding-right: ($theme-spacing) / 2;
}
.buttonCancelContainer {
padding-left: ($theme-spacing) / 2;
}
.button {
width: 100%;
}

View File

@ -1,18 +0,0 @@
@import '../../variables.scss';
.infoContainer {
margin-bottom: ($theme-spacing) * 2;
}
.imageContainer {
text-align: center;
img {
width: 120px;
}
}
.retryButtonContainer {
text-align: center;
padding-top: ($theme-spacing) * 2;
}

View File

@ -1,14 +0,0 @@
import { Dispatch } from "redux";
import { getPreferedMethod, getPreferedMethodSuccess, getPreferedMethodFailure } from "../reducers/Portal/SecondFactor/actions";
import AutheliaService from "../services/AutheliaService";
export default async function(dispatch: Dispatch) {
dispatch(getPreferedMethod());
try {
const method = await AutheliaService.fetchPrefered2faMethod();
console.log(method);
dispatch(getPreferedMethodSuccess(method));
} catch (err) {
dispatch(getPreferedMethodFailure(err.message))
}
}

View File

@ -1,12 +0,0 @@
import { Dispatch } from "redux";
import { fetchStateFailure, fetchStateSuccess } from "../reducers/Portal/Authentication/actions";
import AutheliaService from "../services/AutheliaService";
export default async function(dispatch: Dispatch) {
try {
const state = await AutheliaService.fetchState();
dispatch(fetchStateSuccess(state));
} catch (err) {
dispatch(fetchStateFailure(err.message));
}
}

View File

@ -1,13 +0,0 @@
import { Dispatch } from "redux";
import AutheliaService from "../services/AutheliaService";
import { getAvailbleMethods, getAvailbleMethodsSuccess, getAvailbleMethodsFailure } from "../reducers/Portal/SecondFactor/actions";
export default async function(dispatch: Dispatch) {
dispatch(getAvailbleMethods());
try {
const methods = await AutheliaService.getAvailable2faMethods();
dispatch(getAvailbleMethodsSuccess(methods));
} catch (err) {
dispatch(getAvailbleMethodsFailure(err.message))
}
}

View File

@ -1,15 +0,0 @@
import { Dispatch } from "redux";
import { logout, logoutFailure, logoutSuccess } from "../reducers/Portal/SecondFactor/actions";
import fetchState from "./FetchStateBehavior";
import AutheliaService from "../services/AutheliaService";
export default async function(dispatch: Dispatch) {
try {
dispatch(logout());
await AutheliaService.postLogout();
dispatch(logoutSuccess());
await fetchState(dispatch);
} catch (err) {
dispatch(logoutFailure(err.message));
}
}

View File

@ -1,14 +0,0 @@
import { Dispatch } from "redux";
import { setPreferedMethod, setPreferedMethodSuccess, setPreferedMethodFailure } from "../reducers/Portal/SecondFactor/actions";
import AutheliaService from "../services/AutheliaService";
import Method2FA from "../types/Method2FA";
export default async function(dispatch: Dispatch, method: Method2FA) {
dispatch(setPreferedMethod());
try {
await AutheliaService.setPrefered2faMethod(method);
dispatch(setPreferedMethodSuccess());
} catch (err) {
dispatch(setPreferedMethodFailure(err.message))
}
}

View File

@ -1,15 +0,0 @@
import { Dispatch } from "redux";
import AutheliaService from "../services/AutheliaService";
import { triggerDuoPushAuth, triggerDuoPushAuthSuccess, triggerDuoPushAuthFailure } from "../reducers/Portal/SecondFactor/actions";
export default async function(dispatch: Dispatch, redirectionUrl: string | null) {
dispatch(triggerDuoPushAuth());
try {
const body = await AutheliaService.triggerDuoPush(redirectionUrl);
dispatch(triggerDuoPushAuthSuccess());
return body;
} catch (err) {
console.error(err);
dispatch(triggerDuoPushAuthFailure(err.message))
}
}

View File

@ -1,43 +0,0 @@
import React, { Component } from "react";
import classnames from 'classnames';
import styles from '../../assets/scss/components/AlreadyAuthenticated/AlreadyAuthenticated.module.scss';
import Button from "@material/react-button";
import CircleLoader, { Status } from "../CircleLoader/CircleLoader";
export interface OwnProps {
username: string;
redirectionUrl: string | null;
}
export interface DispatchProps {
onLogoutClicked: () => void;
}
export type Props = OwnProps & DispatchProps;
class AlreadyAuthenticated extends Component<Props> {
render() {
return (
<div className={classnames(styles.container, 'already-authenticated-step')}>
<div className={styles.successContainer}>
<div className={styles.messageContainer}>
<span className={styles.username}>{this.props.username}</span>
you are authenticated
</div>
<div className={styles.statusIcon}><CircleLoader status={Status.SUCCESSFUL} /></div>
</div>
{(this.props.redirectionUrl) ? <a href={this.props.redirectionUrl}>{this.props.redirectionUrl}</a> : null}
<div className={styles.logoutButtonContainer}>
<Button
onClick={this.props.onLogoutClicked}
color="red">
Logout
</Button>
</div>
</div>
)
}
}
export default AlreadyAuthenticated;

View File

@ -1,44 +0,0 @@
import React, { Component } from "react";
import classnames from 'classnames';
import styles from '../../assets/scss/components/CircleLoader/CircleLoader.module.scss';
export enum Status {
LOADING,
SUCCESSFUL,
FAILURE,
}
export interface Props {
status: Status;
}
class CircleLoader extends Component<Props> {
render() {
const containerClasses = [styles.circleLoader];
const checkmarkClasses = [styles.checkmark, styles.draw];
const crossClasses = [styles.cross, styles.draw];
if (this.props.status === Status.SUCCESSFUL) {
containerClasses.push(styles.loadComplete);
containerClasses.push(styles.success);
checkmarkClasses.push(styles.show);
}
else if (this.props.status === Status.FAILURE) {
containerClasses.push(styles.loadComplete);
containerClasses.push(styles.failure);
crossClasses.push(styles.show);
}
const key = 'container-' + this.props.status;
return (
<div className={classnames(containerClasses)} key={key}>
{<div className={classnames(checkmarkClasses)} />}
{<div className={classnames(crossClasses)} />}
</div>
)
}
}
export default CircleLoader;

View File

@ -1,145 +0,0 @@
import React, { Component, KeyboardEvent, FormEvent } from "react";
import TextField, {Input} from '@material/react-text-field';
import Button from '@material/react-button';
import Checkbox from '@material/react-checkbox';
import { Link } from "react-router-dom";
import Notification from "../../components/Notification/Notification";
import styles from '../../assets/scss/components/FirstFactorForm/FirstFactorForm.module.scss';
export interface OwnProps {
redirectionUrl: string | null;
}
export interface StateProps {
formDisabled: boolean;
error: string | null;
username: string;
password: string;
}
export interface DispatchProps {
onUsernameChanged(username: string): void;
onPasswordChanged(password: string): void;
onAuthenticationRequested(username: string, password: string, rememberMe: boolean): void;
}
export type Props = OwnProps & StateProps & DispatchProps;
interface State {
rememberMe: boolean;
}
class FirstFactorForm extends Component<Props, State> {
constructor(props: Props) {
super(props)
this.state = {
rememberMe: false,
}
}
toggleRememberMe = () => {
this.setState({
rememberMe: !(this.state.rememberMe)
})
}
onUsernameChanged = (e: FormEvent<HTMLElement>) => {
const val = (e.target as HTMLInputElement).value;
this.props.onUsernameChanged(val);
}
onPasswordChanged = (e: FormEvent<HTMLElement>) => {
const val = (e.target as HTMLInputElement).value;
this.props.onPasswordChanged(val);
}
onLoginClicked = () => {
this.authenticate();
}
onPasswordKeyPressed = (e: KeyboardEvent) => {
if (e.key === 'Enter') {
this.authenticate();
}
}
render() {
return (
<div className='first-factor-step'>
<Notification
show={this.props.error != null}
className={styles.notification}>
{this.props.error || ''}
</Notification>
<div className={styles.fields}>
<div className={styles.field}>
<TextField
className={styles.input}
label="Username"
outlined={true}>
<Input
id="username"
name="username"
onChange={this.onUsernameChanged}
disabled={this.props.formDisabled}
value={this.props.username}/>
</TextField>
</div>
<div className={styles.field}>
<TextField
className={styles.input}
label="Password"
outlined={true}>
<Input
id="password"
name="password"
type="password"
disabled={this.props.formDisabled}
onChange={this.onPasswordChanged}
onKeyPress={this.onPasswordKeyPressed}
value={this.props.password} />
</TextField>
</div>
</div>
<div>
<div className={styles.buttons}>
<Button
onClick={this.onLoginClicked}
color='primary'
raised={true}
id='login-button'
disabled={this.props.formDisabled}>
Login
</Button>
</div>
<div className={styles.controls}>
<div className={styles.rememberMe}>
<Checkbox
nativeControlId='remember-checkbox'
checked={this.state.rememberMe}
onChange={this.toggleRememberMe}
/>
<label htmlFor='remember-checkbox'>Remember me</label>
</div>
<div className={styles.resetPassword}>
<Link to="/forgot-password">Forgot password?</Link>
</div>
</div>
</div>
</div>
)
}
private authenticate() {
this.props.onAuthenticationRequested(
this.props.username,
this.props.password,
this.state.rememberMe)
}
}
export default FirstFactorForm;

View File

@ -1,21 +0,0 @@
import React, { Component } from "react";
import classnames from 'classnames';
import styles from '../../assets/scss/components/Notification/Notification.module.scss';
interface Props {
className?: string;
show: boolean;
}
class Notification extends Component<Props> {
render() {
return (this.props.show)
? (<div className={classnames(styles.container, this.props.className, 'notification')}>
{this.props.children}
</div>)
: null;
}
}
export default Notification;

View File

@ -1,50 +0,0 @@
import React from 'react';
import classnames from 'classnames';
import CircleLoader, { Status } from '../../components/CircleLoader/CircleLoader';
import styles from '../../assets/scss/components/SecondFactorDuoPush/SecondFactorDuoPush.module.scss';
import { Button } from '@material/react-button';
export interface OwnProps {
redirectionUrl: string | null;
}
export interface StateProps {
duoPushVerified: boolean | null;
duoPushError: string | null;
}
export interface DispatchProps {
onInit: () => void;
onRetryClicked: () => void;
}
export type Props = OwnProps & StateProps & DispatchProps;
export default class SecondFactorDuoPush extends React.Component<Props> {
componentWillMount() {
this.props.onInit();
}
render() {
let u2fStatus = Status.LOADING;
if (this.props.duoPushVerified === true) {
u2fStatus = Status.SUCCESSFUL;
} else if (this.props.duoPushError) {
u2fStatus = Status.FAILURE;
}
return (
<div className={classnames('duo-push-view')}>
<div>You will soon receive a push notification on your phone.</div>
<div className={styles.imageContainer}>
<CircleLoader status={u2fStatus}></CircleLoader>
</div>
{(u2fStatus == Status.FAILURE)
? <div className={styles.retryContainer}>
<Button raised onClick={this.props.onRetryClicked}>Retry</Button>
</div>
: null}
</div>
)
}
}

View File

@ -1,83 +0,0 @@
import React, { Component } from 'react';
import styles from '../../assets/scss/components/SecondFactorForm/SecondFactorForm.module.scss';
import Method2FA from '../../types/Method2FA';
import SecondFactorTOTP from '../../containers/components/SecondFactorTOTP/SecondFactorTOTP';
import SecondFactorU2F from '../../containers/components/SecondFactorU2F/SecondFactorU2F';
import classnames from 'classnames';
import SecondFactorDuoPush from '../../containers/components/SecondFactorDuoPush/SecondFactorDuoPush';
import UseAnotherMethod from '../../containers/components/UseAnotherMethod/UseAnotherMethod';
export interface OwnProps {
username: string;
redirectionUrl: string | null;
}
export interface StateProps {
method: Method2FA | null;
useAnotherMethod: boolean;
}
export interface DispatchProps {
onInit: () => void;
onLogoutClicked: () => void;
onUseAnotherMethodClicked: () => void;
}
export type Props = OwnProps & StateProps & DispatchProps;
class SecondFactorForm extends Component<Props> {
componentDidMount() {
this.props.onInit();
}
private renderMethod() {
let method: Method2FA = (this.props.method) ? this.props.method : 'totp'
let methodComponent, title: string;
if (method == 'u2f') {
title = "Security Key";
methodComponent = (<SecondFactorU2F redirectionUrl={this.props.redirectionUrl}></SecondFactorU2F>);
} else if (method == "duo_push") {
title = "Duo Push Notification";
methodComponent = (<SecondFactorDuoPush redirectionUrl={this.props.redirectionUrl}></SecondFactorDuoPush>);
} else {
title = "One-Time Password"
methodComponent = (<SecondFactorTOTP redirectionUrl={this.props.redirectionUrl}></SecondFactorTOTP>);
}
return (
<div className={classnames('second-factor-step')} key={method + '-method'}>
<div className={styles.methodName}>{title}</div>
{methodComponent}
</div>
);
}
private renderUseAnotherMethodLink() {
return (
<div className={styles.anotherMethodLink}>
<a onClick={this.props.onUseAnotherMethodClicked}>
Use another method
</a>
</div>
);
}
render() {
return (
<div className={styles.container}>
<div className={styles.header}>
<div className={styles.hello}>Hello <b>{this.props.username}</b></div>
<div className={styles.logout}>
<a onClick={this.props.onLogoutClicked}>Logout</a>
</div>
</div>
<div className={styles.body}>
{(this.props.useAnotherMethod) ? <UseAnotherMethod/> : this.renderMethod()}
</div>
{(this.props.useAnotherMethod) ? null : this.renderUseAnotherMethodLink()}
</div>
)
}
}
export default SecondFactorForm;

View File

@ -1,89 +0,0 @@
import React, { FormEvent, KeyboardEvent } from 'react';
import classnames from 'classnames';
import TextField, { Input } from '@material/react-text-field';
import Button from '@material/react-button';
import Notification from '../Notification/Notification';
import styles from '../../assets/scss/components/SecondFactorTOTP/SecondFactorTOTP.module.scss';
export interface OwnProps {
redirectionUrl: string | null;
}
export interface StateProps {
oneTimePasswordVerificationInProgress: boolean,
oneTimePasswordVerificationError: string | null;
}
export interface DispatchProps {
onRegisterOneTimePasswordClicked: () => void;
onOneTimePasswordValidationRequested: (token: string) => void;
}
type Props = OwnProps & StateProps & DispatchProps;
interface State {
oneTimePassword: string;
}
export default class SecondFactorTOTP extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
oneTimePassword: '',
}
}
private onOneTimePasswordChanged = (e: FormEvent<HTMLInputElement>) => {
this.setState({oneTimePassword: (e.target as HTMLInputElement).value});
}
private onTotpKeyPressed = (e: KeyboardEvent) => {
if (e.key === 'Enter') {
this.onOneTimePasswordValidationRequested();
}
}
private onOneTimePasswordValidationRequested = () => {
if (this.props.oneTimePasswordVerificationInProgress) return;
this.props.onOneTimePasswordValidationRequested(this.state.oneTimePassword);
}
render() {
return (
<div className={classnames('one-time-password-view')}>
<Notification show={this.props.oneTimePasswordVerificationError !== null}>
{this.props.oneTimePasswordVerificationError}
</Notification>
<TextField
className={styles.totpField}
label="One-Time Password"
outlined={true}>
<Input
name='totp-token'
id='totp-token'
onChange={this.onOneTimePasswordChanged as any}
onKeyPress={this.onTotpKeyPressed}
value={this.state.oneTimePassword} />
</TextField>
<div className={styles.registerDeviceContainer}>
<a className={classnames(styles.registerDevice, 'register-totp')}
onClick={this.props.onRegisterOneTimePasswordClicked}>
Register new device
</a>
</div>
<div className={styles.totpButton}>
<Button
color="primary"
raised={true}
id='totp-button'
onClick={this.onOneTimePasswordValidationRequested}
disabled={this.props.oneTimePasswordVerificationInProgress}>
OK
</Button>
</div>
</div>
)
}
}

View File

@ -1,52 +0,0 @@
import React from 'react';
import classnames from 'classnames';
import CircleLoader, { Status } from '../../components/CircleLoader/CircleLoader';
import styles from '../../assets/scss/components/SecondFactorU2F/SecondFactorU2F.module.scss';
export interface OwnProps {
redirectionUrl: string | null;
}
export interface StateProps {
securityKeyVerified: boolean;
securityKeyError: string | null;
}
export interface DispatchProps {
onInit: () => void;
onRegisterSecurityKeyClicked: () => void;
}
export type Props = StateProps & DispatchProps;
interface State {}
export default class SecondFactorU2F extends React.Component<Props, State> {
componentWillMount() {
this.props.onInit();
}
render() {
let u2fStatus = Status.LOADING;
if (this.props.securityKeyVerified) {
u2fStatus = Status.SUCCESSFUL;
} else if (this.props.securityKeyError) {
u2fStatus = Status.FAILURE;
}
return (
<div className={classnames('security-key-view')}>
<div>Insert your security key into a USB port and touch the gold disk.</div>
<div className={styles.imageContainer}>
<CircleLoader status={u2fStatus}></CircleLoader>
</div>
<div className={styles.registerDeviceContainer}>
<a className={classnames(styles.registerDevice, 'register-u2f')}
onClick={this.props.onRegisterSecurityKeyClicked}>
Register new device
</a>
</div>
</div>
)
}
}

View File

@ -1,67 +0,0 @@
import React, { Component } from 'react';
import styles from '../../assets/scss/components/SecondFactorForm/SecondFactorForm.module.scss';
import Method2FA from '../../types/Method2FA';
import { Button } from '@material/react-button';
import classnames from 'classnames';
export interface OwnProps {}
export interface StateProps {
availableMethods: Method2FA[] | null;
isSecurityKeySupported: boolean;
}
export interface DispatchProps {
onOneTimePasswordMethodClicked: () => void;
onSecurityKeyMethodClicked: () => void;
onDuoPushMethodClicked: () => void;
}
export type Props = OwnProps & StateProps & DispatchProps;
interface MethodDescription {
name: string;
onClicked: () => void;
key: Method2FA;
}
class UseAnotherMethod extends Component<Props> {
render() {
const methods: MethodDescription[] = [
{
name: "One-Time Password",
onClicked: this.props.onOneTimePasswordMethodClicked,
key: "totp"
},
{
name: "Security Key (U2F)",
onClicked: this.props.onSecurityKeyMethodClicked,
key: "u2f"
},
{
name: "Duo Push Notification",
onClicked: this.props.onDuoPushMethodClicked,
key: "duo_push"
}
];
const methodsComponents = methods
// Filter out security key if not supported by browser.
.filter(m => m.key !== "u2f" || (m.key === "u2f" && this.props.isSecurityKeySupported))
// Filter out the methods that are not supported by the server.
.filter(m => this.props.availableMethods && this.props.availableMethods.includes(m.key))
// Create the buttons
.map(m => <Button raised onClick={m.onClicked} key={m.key}>{m.name}</Button>);
return (
<div className={classnames('use-another-method-view')}>
<div>Choose a method</div>
<div className={styles.buttonsContainer}>
{methodsComponents}
</div>
</div>
)
}
}
export default UseAnotherMethod;

View File

@ -1,3 +0,0 @@
export const AUTHELIA_URL = "https://www.authelia.com/"
export const AUTHELIA_GITHUB_URL = "https://github.com/clems4ever/authelia";

View File

@ -1,17 +0,0 @@
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { RootState } from '../../../reducers';
import AlreadyAuthenticated, { DispatchProps } from '../../../components/AlreadyAuthenticated/AlreadyAuthenticated';
import LogoutBehavior from '../../../behaviors/LogoutBehavior';
const mapStateToProps = (state: RootState) => {
return {};
}
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => {
return {
onLogoutClicked: () => LogoutBehavior(dispatch),
}
}
export default connect(mapStateToProps, mapDispatchToProps)(AlreadyAuthenticated);

View File

@ -1,59 +0,0 @@
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import {
authenticateFailure,
authenticateSuccess,
authenticate,
setUsername,
setPassword
} from '../../../reducers/Portal/FirstFactor/actions';
import FirstFactorForm, { StateProps, OwnProps } from '../../../components/FirstFactorForm/FirstFactorForm';
import { RootState } from '../../../reducers';
import FetchStateBehavior from '../../../behaviors/FetchStateBehavior';
import AutheliaService from '../../../services/AutheliaService';
const mapStateToProps = (state: RootState): StateProps => {
return {
error: state.firstFactor.error,
formDisabled: state.firstFactor.loading,
username: state.firstFactor.username,
password: state.firstFactor.password,
};
}
function onAuthenticationRequested(dispatch: Dispatch, redirectionUrl: string | null) {
return async (username: string, password: string, rememberMe: boolean): Promise<void> => {
// Validate first factor
dispatch(authenticate());
try {
const redirectOrUndefined = await AutheliaService.postFirstFactorAuth(
username, password, rememberMe, redirectionUrl);
if (redirectOrUndefined) {
window.location.href = redirectOrUndefined.redirect;
return;
}
dispatch(authenticateSuccess());
dispatch(setUsername(''));
dispatch(setPassword(''));
// fetch state to move to next stage in case redirect is not possible
await FetchStateBehavior(dispatch);
} catch (err) {
dispatch(setPassword(''));
dispatch(authenticateFailure(err.message));
}
}
}
const mapDispatchToProps = (dispatch: Dispatch, ownProps: OwnProps) => {
return {
onUsernameChanged: function(username: string) {
dispatch(setUsername(username));
},
onPasswordChanged: function(password: string) {
dispatch(setPassword(password));
},
onAuthenticationRequested: onAuthenticationRequested(dispatch, ownProps.redirectionUrl),
}
}
export default connect(mapStateToProps, mapDispatchToProps)(FirstFactorForm);

View File

@ -1,54 +0,0 @@
import { connect } from 'react-redux';
import { RootState } from '../../../reducers';
import { Dispatch } from 'redux';
import SecondFactorDuoPush, { StateProps, OwnProps, DispatchProps } from '../../../components/SecondFactorDuoPush/SecondFactorDuoPush';
import FetchStateBehavior from '../../../behaviors/FetchStateBehavior';
import TriggerDuoPushAuth from '../../../behaviors/TriggerDuoPushAuth';
const mapStateToProps = (state: RootState): StateProps => ({
duoPushVerified: state.secondFactor.duoPushVerificationSuccess,
duoPushError: state.secondFactor.duoPushVerificationError,
});
async function redirectIfPossible(body: any) {
if (body && 'redirect' in body) {
window.location.href = body['redirect'];
return true;
}
return false;
}
async function handleSuccess(dispatch: Dispatch, body: {redirect: string} | undefined, duration?: number) {
async function handle() {
const redirected = await redirectIfPossible(body);
if (!redirected) {
await FetchStateBehavior(dispatch);
}
}
if (duration) {
setTimeout(handle, duration);
} else {
await handle();
}
}
async function triggerDuoPushAuth(dispatch: Dispatch, redirectionUrl: string | null) {
const body = await TriggerDuoPushAuth(dispatch, redirectionUrl);
await handleSuccess(dispatch, body, 1000);
}
const mapDispatchToProps = (dispatch: Dispatch, ownProps: OwnProps): DispatchProps => {
return {
onInit: async () => {
await triggerDuoPushAuth(dispatch, ownProps.redirectionUrl);
},
onRetryClicked: async () => {
await triggerDuoPushAuth(dispatch, ownProps.redirectionUrl);
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(SecondFactorDuoPush);

View File

@ -1,32 +0,0 @@
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import SecondFactorForm from '../../../components/SecondFactorForm/SecondFactorForm';
import LogoutBehavior from '../../../behaviors/LogoutBehavior';
import { RootState } from '../../../reducers';
import { StateProps, DispatchProps } from '../../../components/SecondFactorForm/SecondFactorForm';
import FetchPrefered2faMethod from '../../../behaviors/FetchPrefered2faMethod';
import { setUseAnotherMethod, setSecurityKeySupported } from '../../../reducers/Portal/SecondFactor/actions';
import GetAvailable2faMethods from '../../../behaviors/GetAvailable2faMethods';
import u2fApi from 'u2f-api';
const mapStateToProps = (state: RootState): StateProps => {
return {
method: state.secondFactor.preferedMethod,
useAnotherMethod: state.secondFactor.userAnotherMethod,
}
}
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => {
return {
onInit: async () => {
dispatch(setSecurityKeySupported(await u2fApi.isSupported()));
FetchPrefered2faMethod(dispatch);
GetAvailable2faMethods(dispatch);
},
onLogoutClicked: () => LogoutBehavior(dispatch),
onUseAnotherMethodClicked: () => dispatch(setUseAnotherMethod(true)),
}
}
export default connect(mapStateToProps, mapDispatchToProps)(SecondFactorForm);

View File

@ -1,57 +0,0 @@
import { connect } from 'react-redux';
import SecondFactorTOTP, { StateProps, OwnProps } from "../../../components/SecondFactorTOTP/SecondFactorTOTP";
import { RootState } from '../../../reducers';
import { Dispatch } from 'redux';
import {
oneTimePasswordVerification,
oneTimePasswordVerificationFailure,
oneTimePasswordVerificationSuccess
} from '../../../reducers/Portal/SecondFactor/actions';
import AutheliaService from '../../../services/AutheliaService';
import { push } from 'connected-react-router';
import FetchStateBehavior from '../../../behaviors/FetchStateBehavior';
const mapStateToProps = (state: RootState): StateProps => ({
oneTimePasswordVerificationInProgress: state.secondFactor.oneTimePasswordVerificationLoading,
oneTimePasswordVerificationError: state.secondFactor.oneTimePasswordVerificationError,
});
async function handleSuccess(dispatch: Dispatch, duration?: number) {
async function handle() {
await FetchStateBehavior(dispatch);
}
if (duration) {
setTimeout(handle, duration);
} else {
await handle();
}
}
const mapDispatchToProps = (dispatch: Dispatch, ownProps: OwnProps) => {
return {
onOneTimePasswordValidationRequested: async (token: string) => {
try {
dispatch(oneTimePasswordVerification());
const response = await AutheliaService.verifyTotpToken(token, ownProps.redirectionUrl);
dispatch(oneTimePasswordVerificationSuccess());
if (response) {
window.location.href = response.redirect;
return;
}
await handleSuccess(dispatch);
} catch (err) {
console.error(err);
dispatch(oneTimePasswordVerificationFailure(err.message));
}
},
onRegisterOneTimePasswordClicked: async () => {
await AutheliaService.startTOTPRegistrationIdentityProcess();
await dispatch(push('/confirmation-sent'));
},
}
}
export default connect(mapStateToProps, mapDispatchToProps)(SecondFactorTOTP);

View File

@ -1,75 +0,0 @@
import { connect } from 'react-redux';
import { RootState } from '../../../reducers';
import { Dispatch } from 'redux';
import SecondFactorU2F, { StateProps, OwnProps } from '../../../components/SecondFactorU2F/SecondFactorU2F';
import AutheliaService from '../../../services/AutheliaService';
import { push } from 'connected-react-router';
import u2fApi from 'u2f-api';
import {
securityKeySignSuccess,
securityKeySign,
securityKeySignFailure,
} from '../../../reducers/Portal/SecondFactor/actions';
import FetchStateBehavior from '../../../behaviors/FetchStateBehavior';
const mapStateToProps = (state: RootState): StateProps => ({
securityKeyVerified: state.secondFactor.securityKeySignSuccess || false,
securityKeyError: state.secondFactor.error,
});
async function triggerSecurityKeySigning(dispatch: Dispatch, redirectionUrl: string | null) {
dispatch(securityKeySign());
const signRequest = await AutheliaService.requestSigning();
const signRequests: u2fApi.SignRequest[] = [];
for (var i in signRequest.registeredKeys) {
const r = signRequest.registeredKeys[i];
signRequests.push({
appId: signRequest.appId,
challenge: signRequest.challenge,
keyHandle: r.keyHandle,
version: r.version,
})
}
const signResponse = await u2fApi.sign(signRequests, 60);
const response = await AutheliaService.completeSecurityKeySigning(signResponse, redirectionUrl);
dispatch(securityKeySignSuccess());
if (response) {
window.location.href = response.redirect;
return;
}
await handleSuccess(dispatch, 1000);
}
async function handleSuccess(dispatch: Dispatch, duration?: number) {
async function handle() {
await FetchStateBehavior(dispatch);
}
if (duration) {
setTimeout(handle, duration);
} else {
await handle();
}
}
const mapDispatchToProps = (dispatch: Dispatch, ownProps: OwnProps) => {
return {
onRegisterSecurityKeyClicked: async () => {
await AutheliaService.startU2FRegistrationIdentityProcess();
await dispatch(push('/confirmation-sent'));
},
onInit: async () => {
try {
await triggerSecurityKeySigning(dispatch, ownProps.redirectionUrl);
} catch (err) {
console.error(err);
await dispatch(securityKeySignFailure(err.message));
}
},
}
}
export default connect(mapStateToProps, mapDispatchToProps)(SecondFactorU2F);

View File

@ -1,31 +0,0 @@
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { RootState } from '../../../reducers';
import SetPrefered2faMethod from '../../../behaviors/SetPrefered2faMethod';
import { getPreferedMethodSuccess, setUseAnotherMethod, setSecurityKeySupported } from '../../../reducers/Portal/SecondFactor/actions';
import Method2FA from '../../../types/Method2FA';
import UseAnotherMethod, {StateProps, DispatchProps} from '../../../components/UseAnotherMethod/UseAnotherMethod';
const mapStateToProps = (state: RootState): StateProps => ({
availableMethods: state.secondFactor.getAvailableMethodResponse,
isSecurityKeySupported: state.secondFactor.securityKeySupported,
})
async function storeMethod(dispatch: Dispatch, method: Method2FA) {
// display the new option
dispatch(getPreferedMethodSuccess(method));
dispatch(setUseAnotherMethod(false));
// And save the method for next time.
await SetPrefered2faMethod(dispatch, method);
}
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => {
return {
onOneTimePasswordMethodClicked: () => storeMethod(dispatch, 'totp'),
onSecurityKeyMethodClicked: () => storeMethod(dispatch, 'u2f'),
onDuoPushMethodClicked: () => storeMethod(dispatch, "duo_push"),
}
}
export default connect(mapStateToProps, mapDispatchToProps)(UseAnotherMethod);

View File

@ -1,7 +0,0 @@
import { connect } from 'react-redux';
import PortalLayout from '../../../layouts/PortalLayout/PortalLayout';
import { RootState } from '../../../reducers';
const mapStateToProps = (state: RootState) => ({});
export default connect(mapStateToProps)(PortalLayout);

View File

@ -1,48 +0,0 @@
import { connect } from 'react-redux';
import QueryString from 'query-string';
import AuthenticationView, {StateProps, Stage, OwnProps} from '../../../views/AuthenticationView/AuthenticationView';
import { RootState } from '../../../reducers';
import { Dispatch } from 'redux';
import AuthenticationLevel from '../../../types/AuthenticationLevel';
import FetchStateBehavior from '../../../behaviors/FetchStateBehavior';
function authenticationLevelToStage(level: AuthenticationLevel): Stage {
switch (level) {
case AuthenticationLevel.NOT_AUTHENTICATED:
return Stage.FIRST_FACTOR;
case AuthenticationLevel.ONE_FACTOR:
return Stage.SECOND_FACTOR;
case AuthenticationLevel.TWO_FACTOR:
return Stage.ALREADY_AUTHENTICATED;
}
}
const mapStateToProps = (state: RootState, ownProps: OwnProps): StateProps => {
const stage = (state.authentication.remoteState)
? authenticationLevelToStage(state.authentication.remoteState.authentication_level)
: Stage.FIRST_FACTOR;
let url: string | null = null;
if (ownProps.location) {
const params = QueryString.parse(ownProps.location.search);
if ('rd' in params) {
url = params['rd'] as string;
} else if (state.authentication.remoteState && state.authentication.remoteState.default_redirection_url) {
url = state.authentication.remoteState.default_redirection_url;
}
}
return {
redirectionUrl: url,
remoteState: state.authentication.remoteState,
stage: stage,
};
}
const mapDispatchToProps = (dispatch: Dispatch) => {
return {
onInit: async () => await FetchStateBehavior(dispatch)
}
}
export default connect(mapStateToProps, mapDispatchToProps)(AuthenticationView);

View File

@ -1,31 +0,0 @@
import { connect } from 'react-redux';
import { RootState } from '../../../reducers';
import { Dispatch } from 'redux';
import { push } from 'connected-react-router';
import ForgotPasswordView from '../../../views/ForgotPasswordView/ForgotPasswordView';
import { forgotPasswordRequest, forgotPasswordSuccess, forgotPasswordFailure } from '../../../reducers/Portal/ForgotPassword/actions';
import AutheliaService from '../../../services/AutheliaService';
const mapStateToProps = (state: RootState) => ({
disabled: state.forgotPassword.loading,
});
const mapDispatchToProps = (dispatch: Dispatch) => {
return {
onPasswordResetRequested: async (username: string) => {
try {
dispatch(forgotPasswordRequest());
await AutheliaService.initiatePasswordResetIdentityValidation(username);
dispatch(forgotPasswordSuccess());
await dispatch(push('/confirmation-sent'));
} catch (err) {
dispatch(forgotPasswordFailure(err.message));
}
},
onCancelClicked: async () => {
dispatch(push('/'));
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(ForgotPasswordView);

View File

@ -1,17 +0,0 @@
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
import { RootState } from '../../../reducers';
import LogoutView, { DispatchProps } from '../../../views/LogoutView/LogoutView';
import LogoutBehavior from '../../../behaviors/LogoutBehavior';
const mapStateToProps = (state: RootState) => {
return {};
}
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => {
return {
onInit: () => LogoutBehavior(dispatch),
}
}
export default connect(mapStateToProps, mapDispatchToProps)(LogoutView);

View File

@ -1,43 +0,0 @@
import { connect } from 'react-redux';
import OneTimePasswordRegistrationView from '../../../views/OneTimePasswordRegistrationView/OneTimePasswordRegistrationView';
import { RootState } from '../../../reducers';
import { Dispatch } from 'redux';
import { generateTotpSecret, generateTotpSecretSuccess, generateTotpSecretFailure } from '../../../reducers/Portal/OneTimePasswordRegistration/actions';
import { push } from 'connected-react-router';
import AutheliaService from '../../../services/AutheliaService';
const mapStateToProps = (state: RootState) => ({
error: state.oneTimePasswordRegistration.error,
secret: state.oneTimePasswordRegistration.secret,
});
async function tryGenerateTotpSecret(dispatch: Dispatch, token: string) {
try {
dispatch(generateTotpSecret());
const res = await AutheliaService.completeOneTimePasswordRegistrationIdentityValidation(token);
dispatch(generateTotpSecretSuccess(res));
} catch (err) {
dispatch(generateTotpSecretFailure(err.message));
}
}
const mapDispatchToProps = (dispatch: Dispatch) => {
let internalToken: string;
return {
onInit: async (token: string) => {
internalToken = token;
await tryGenerateTotpSecret(dispatch, internalToken);
},
onRetryClicked: async () => {
await tryGenerateTotpSecret(dispatch, internalToken);
},
onCancelClicked: () => {
dispatch(push('/'));
},
onLoginClicked: () => {
dispatch(push('/'));
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(OneTimePasswordRegistrationView);

View File

@ -1,35 +0,0 @@
import { connect } from 'react-redux';
import { RootState } from '../../../reducers';
import { Dispatch } from 'redux';
import { push } from 'connected-react-router';
import ResetPasswordView, { StateProps } from '../../../views/ResetPasswordView/ResetPasswordView';
import AutheliaService from '../../../services/AutheliaService';
const mapStateToProps = (state: RootState): StateProps => ({
disabled: state.resetPassword.loading,
});
const mapDispatchToProps = (dispatch: Dispatch) => {
return {
onInit: async (token: string) => {
try {
await AutheliaService.completePasswordResetIdentityValidation(token);
} catch (err) {
console.error(err);
}
},
onPasswordResetRequested: async (newPassword: string) => {
try {
await AutheliaService.resetPassword(newPassword);
await dispatch(push('/'));
} catch (err) {
console.error(err);
}
},
onCancelClicked: async () => {
await dispatch(push('/'));
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(ResetPasswordView);

View File

@ -1,47 +0,0 @@
import { connect } from 'react-redux';
import SecurityKeyRegistrationView from '../../../views/SecurityKeyRegistrationView/SecurityKeyRegistrationView';
import { RootState } from '../../../reducers';
import { Dispatch } from 'redux';
import U2fApi from "u2f-api";
import { Props } from '../../../views/SecurityKeyRegistrationView/SecurityKeyRegistrationView';
import { registerSecurityKey, registerSecurityKeyFailure, registerSecurityKeySuccess } from '../../../reducers/Portal/SecurityKeyRegistration/actions';
import AutheliaService from '../../../services/AutheliaService';
const mapStateToProps = (state: RootState) => ({
deviceRegistered: state.securityKeyRegistration.success,
error: state.securityKeyRegistration.error,
});
const mapDispatchToProps = (dispatch: Dispatch, ownProps: Props) => {
return {
onInit: async (token: string) => {
try {
dispatch(registerSecurityKey());
const registerRequest = await AutheliaService.completeSecurityKeyRegistrationIdentityValidation(token);
const registerRequests: U2fApi.RegisterRequest[] = [];
for(var i in registerRequest.registerRequests) {
const r = registerRequest.registerRequests[i];
registerRequests.push({
appId: registerRequest.appId,
challenge: r.challenge,
version: r.version,
})
}
const registerResponse = await U2fApi.register(registerRequests, [], 60);
await AutheliaService.completeSecurityKeyRegistration(registerResponse);
dispatch(registerSecurityKeySuccess());
setTimeout(() => {
ownProps.history.push('/');
}, 2000);
} catch(err) {
console.error(err);
dispatch(registerSecurityKeyFailure(err.message));
}
},
onBackClicked: () => {
ownProps.history.push('/');
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(SecurityKeyRegistrationView);

View File

@ -1,16 +0,0 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
background: #eee;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
a {
text-decoration: underline;
cursor: pointer;
}

View File

@ -1,12 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: http://bit.ly/CRA-PWA
serviceWorker.unregister();

View File

@ -1,52 +0,0 @@
import React, { Component } from "react";
import { Route, Switch, Redirect, RouterProps, RouteProps } from "react-router";
import { routes } from '../../routes/routes';
import { AUTHELIA_GITHUB_URL } from "../../constants";
import styles from '../../assets/scss/layouts/PortalLayout/PortalLayout.module.scss';
interface Props extends RouterProps, RouteProps {}
class PortalLayout extends Component<Props> {
private renderTitle() {
if (!this.props.location) return;
for (let i in routes) {
const route = routes[i];
if (route.path && route.path.indexOf(this.props.location.pathname) > -1) {
return route.title.toUpperCase();
}
}
return;
}
render() {
return (
<div className={styles.main}>
<div className={styles.mainContent}>
<div className={styles.title}>
{this.renderTitle()}
</div>
<div className={styles.frame}>
<div className={styles.innerFrame}>
<Switch>
{routes.map((r, key) => {
return <Route path={r.path} component={r.component} exact={true} key={key} />
})}
<Redirect to='/' />
</Switch>
</div>
</div>
<div className={styles.footer}>
<div><a href={AUTHELIA_GITHUB_URL}>Powered by Authelia</a></div>
</div>
</div>
</div>
)
}
}
export default PortalLayout;

View File

@ -1 +0,0 @@
/// <reference types="react-scripts" />

View File

@ -1,20 +0,0 @@
import { createAction } from 'typesafe-actions';
import {
FETCH_STATE_REQUEST,
FETCH_STATE_SUCCESS,
FETCH_STATE_FAILURE,
} from "../../constants";
import RemoteState from '../../../views/AuthenticationView/RemoteState';
/* FETCH_STATE */
export const fetchState = createAction(FETCH_STATE_REQUEST);
export const fetchStateSuccess = createAction(FETCH_STATE_SUCCESS, resolve => {
return (state: RemoteState) => {
return resolve(state);
}
});
export const fetchStateFailure = createAction(FETCH_STATE_FAILURE, resolve => {
return (err: string) => {
return resolve(err);
}
});

View File

@ -1,43 +0,0 @@
import * as Actions from './actions';
import { ActionType, getType } from 'typesafe-actions';
import RemoteState from '../../../views/AuthenticationView/RemoteState';
export type Action = ActionType<typeof Actions>;
interface State {
remoteState: RemoteState | null;
remoteStateLoading: boolean;
remoteStateError: string | null;
}
const initialState: State = {
remoteState: null,
remoteStateLoading: false,
remoteStateError: null,
}
export default (state = initialState, action: Action): State => {
switch(action.type) {
case getType(Actions.fetchState):
return {
...state,
remoteState: null,
remoteStateError: null,
remoteStateLoading: true,
};
case getType(Actions.fetchStateSuccess):
return {
...state,
remoteState: action.payload,
remoteStateLoading: false,
};
case getType(Actions.fetchStateFailure):
return {
...state,
remoteStateError: action.payload,
remoteStateLoading: false,
};
}
return state;
}

View File

@ -1,23 +0,0 @@
import { createAction } from 'typesafe-actions';
import {
AUTHENTICATE_REQUEST,
AUTHENTICATE_SUCCESS,
AUTHENTICATE_FAILURE,
FIRST_FACTOR_SET_USERNAME,
FIRST_FACTOR_SET_PASSWORD
} from "../../constants";
/* AUTHENTICATE_REQUEST */
export const authenticate = createAction(AUTHENTICATE_REQUEST);
export const authenticateSuccess = createAction(AUTHENTICATE_SUCCESS);
export const authenticateFailure = createAction(AUTHENTICATE_FAILURE, resolve => {
return (error: string) => resolve(error);
});
export const setUsername = createAction(FIRST_FACTOR_SET_USERNAME, resolve => {
return (username: string) => resolve(username);
});
export const setPassword = createAction(FIRST_FACTOR_SET_PASSWORD, resolve => {
return (password: string) => resolve(password);
});

View File

@ -1,63 +0,0 @@
import * as Actions from './actions';
import { ActionType, getType } from 'typesafe-actions';
export type FirstFactorAction = ActionType<typeof Actions>;
enum Result {
NONE,
SUCCESS,
FAILURE,
}
interface FirstFactorState {
lastResult: Result;
loading: boolean;
error: string | null;
username: string;
password: string;
}
const firstFactorInitialState: FirstFactorState = {
lastResult: Result.NONE,
loading: false,
error: null,
username: '',
password: '',
}
export default (state = firstFactorInitialState, action: FirstFactorAction): FirstFactorState => {
switch(action.type) {
case getType(Actions.authenticate):
return {
...state,
loading: true,
error: null
};
case getType(Actions.authenticateSuccess):
return {
...state,
lastResult: Result.SUCCESS,
loading: false,
error: null,
};
case getType(Actions.authenticateFailure):
return {
...state,
lastResult: Result.FAILURE,
loading: false,
error: action.payload,
};
case getType(Actions.setUsername):
return {
...state,
username: action.payload,
}
case getType(Actions.setPassword):
return {
...state,
password: action.payload,
}
}
return state;
}

View File

@ -1,13 +0,0 @@
import { createAction } from 'typesafe-actions';
import {
FORGOT_PASSWORD_REQUEST,
FORGOT_PASSWORD_SUCCESS,
FORGOT_PASSWORD_FAILURE
} from "../../constants";
/* AUTHENTICATE_REQUEST */
export const forgotPasswordRequest = createAction(FORGOT_PASSWORD_REQUEST);
export const forgotPasswordSuccess = createAction(FORGOT_PASSWORD_SUCCESS);
export const forgotPasswordFailure = createAction(FORGOT_PASSWORD_FAILURE, resolve => {
return (error: string) => resolve(error);
});

View File

@ -1,44 +0,0 @@
import * as Actions from './actions';
import { ActionType, getType } from 'typesafe-actions';
export type Action = ActionType<typeof Actions>;
interface State {
loading: boolean;
success: boolean | null;
error: string | null;
}
const initialState: State = {
loading: false,
success: null,
error: null,
}
export default (state = initialState, action: Action): State => {
switch(action.type) {
case getType(Actions.forgotPasswordRequest):
return {
...state,
loading: true,
error: null
};
case getType(Actions.forgotPasswordSuccess):
return {
...state,
success: true,
loading: false,
error: null,
};
case getType(Actions.forgotPasswordFailure):
return {
...state,
success: false,
loading: false,
error: action.payload,
};
}
return state;
}

View File

@ -1,13 +0,0 @@
import { createAction } from "typesafe-actions";
import { GENERATE_TOTP_SECRET_REQUEST, GENERATE_TOTP_SECRET_SUCCESS, GENERATE_TOTP_SECRET_FAILURE } from "../../constants";
import { Secret } from "../../../views/OneTimePasswordRegistrationView/Secret";
/* GENERATE_TOTP_SECRET_REQUEST */
export const generateTotpSecret = createAction(GENERATE_TOTP_SECRET_REQUEST);
export const generateTotpSecretSuccess = createAction(GENERATE_TOTP_SECRET_SUCCESS, resolve => {
return (secret: Secret) => resolve(secret);
});
export const generateTotpSecretFailure = createAction(GENERATE_TOTP_SECRET_FAILURE, resolve => {
return (error: string) => resolve(error);
});

View File

@ -1,41 +0,0 @@
import { ActionType, getType } from "typesafe-actions";
import * as Actions from './actions';
import { Secret } from "../../../views/OneTimePasswordRegistrationView/Secret";
type OneTimePasswordRegistrationAction = ActionType<typeof Actions>
export interface OneTimePasswordRegistrationState {
loading: boolean;
error: string | null;
secret: Secret | null;
}
let oneTimePasswordRegistrationInitialState: OneTimePasswordRegistrationState = {
loading: true,
error: null,
secret: null,
}
export default (state = oneTimePasswordRegistrationInitialState, action: OneTimePasswordRegistrationAction): OneTimePasswordRegistrationState => {
switch(action.type) {
case getType(Actions.generateTotpSecret):
return {
loading: true,
error: null,
secret: null,
};
case getType(Actions.generateTotpSecretSuccess):
return {
...state,
loading: false,
secret: action.payload,
}
case getType(Actions.generateTotpSecretFailure):
return {
...state,
loading: false,
error: action.payload,
}
}
return state;
}

View File

@ -1,9 +0,0 @@
import { createAction } from 'typesafe-actions';
import { RESET_PASSWORD_REQUEST, RESET_PASSWORD_SUCCESS, RESET_PASSWORD_FAILURE } from "../../constants";
/* AUTHENTICATE_REQUEST */
export const resetPasswordRequest = createAction(RESET_PASSWORD_REQUEST);
export const resetPasswordSuccess = createAction(RESET_PASSWORD_SUCCESS);
export const resetPasswordFailure = createAction(RESET_PASSWORD_FAILURE, resolve => {
return (error: string) => resolve(error);
});

View File

@ -1,44 +0,0 @@
import * as Actions from './actions';
import { ActionType, getType } from 'typesafe-actions';
export type Action = ActionType<typeof Actions>;
interface State {
loading: boolean;
success: boolean | null;
error: string | null;
}
const initialState: State = {
loading: false,
success: null,
error: null,
}
export default (state = initialState, action: Action): State => {
switch(action.type) {
case getType(Actions.resetPasswordRequest):
return {
...state,
loading: true,
error: null
};
case getType(Actions.resetPasswordSuccess):
return {
...state,
success: true,
loading: false,
error: null,
};
case getType(Actions.resetPasswordFailure):
return {
...state,
success: false,
loading: false,
error: action.payload,
};
}
return state;
}

View File

@ -1,88 +0,0 @@
import { createAction } from "typesafe-actions";
import {
LOGOUT_REQUEST,
LOGOUT_SUCCESS,
LOGOUT_FAILURE,
SECURITY_KEY_SIGN,
SECURITY_KEY_SIGN_SUCCESS,
SECURITY_KEY_SIGN_FAILURE,
SET_SECURITY_KEY_SUPPORTED,
ONE_TIME_PASSWORD_VERIFICATION_REQUEST,
ONE_TIME_PASSWORD_VERIFICATION_SUCCESS,
ONE_TIME_PASSWORD_VERIFICATION_FAILURE,
GET_PREFERED_METHOD,
GET_PREFERED_METHOD_SUCCESS,
GET_PREFERED_METHOD_FAILURE,
SET_PREFERED_METHOD,
SET_PREFERED_METHOD_FAILURE,
SET_PREFERED_METHOD_SUCCESS,
SET_USE_ANOTHER_METHOD,
TRIGGER_DUO_PUSH_AUTH,
TRIGGER_DUO_PUSH_AUTH_SUCCESS,
TRIGGER_DUO_PUSH_AUTH_FAILURE,
GET_AVAILABLE_METHODS,
GET_AVAILABLE_METHODS_SUCCESS,
GET_AVAILABLE_METHODS_FAILURE
} from "../../constants";
import Method2FA from "../../../types/Method2FA";
export const setSecurityKeySupported = createAction(SET_SECURITY_KEY_SUPPORTED, resolve => {
return (supported: boolean) => resolve(supported);
});
export const setUseAnotherMethod = createAction(SET_USE_ANOTHER_METHOD, resolve => {
return (useAnotherMethod: boolean) => resolve(useAnotherMethod);
});
export const getAvailbleMethods = createAction(GET_AVAILABLE_METHODS);
export const getAvailbleMethodsSuccess = createAction(GET_AVAILABLE_METHODS_SUCCESS, resolve => {
return (methods: Method2FA[]) => resolve(methods);
});
export const getAvailbleMethodsFailure = createAction(GET_AVAILABLE_METHODS_FAILURE, resolve => {
return (err: string) => resolve(err);
});
export const getPreferedMethod = createAction(GET_PREFERED_METHOD);
export const getPreferedMethodSuccess = createAction(GET_PREFERED_METHOD_SUCCESS, resolve => {
return (method: Method2FA) => resolve(method);
});
export const getPreferedMethodFailure = createAction(GET_PREFERED_METHOD_FAILURE, resolve => {
return (err: string) => resolve(err);
});
export const setPreferedMethod = createAction(SET_PREFERED_METHOD);
export const setPreferedMethodSuccess = createAction(SET_PREFERED_METHOD_SUCCESS);
export const setPreferedMethodFailure = createAction(SET_PREFERED_METHOD_FAILURE, resolve => {
return (err: string) => resolve(err);
})
export const securityKeySign = createAction(SECURITY_KEY_SIGN);
export const securityKeySignSuccess = createAction(SECURITY_KEY_SIGN_SUCCESS);
export const securityKeySignFailure = createAction(SECURITY_KEY_SIGN_FAILURE, resolve => {
return (error: string) => resolve(error);
});
export const oneTimePasswordVerification = createAction(ONE_TIME_PASSWORD_VERIFICATION_REQUEST);
export const oneTimePasswordVerificationSuccess = createAction(ONE_TIME_PASSWORD_VERIFICATION_SUCCESS);
export const oneTimePasswordVerificationFailure = createAction(ONE_TIME_PASSWORD_VERIFICATION_FAILURE, resolve => {
return (err: string) => resolve(err);
});
export const triggerDuoPushAuth = createAction(TRIGGER_DUO_PUSH_AUTH);
export const triggerDuoPushAuthSuccess = createAction(TRIGGER_DUO_PUSH_AUTH_SUCCESS);
export const triggerDuoPushAuthFailure = createAction(TRIGGER_DUO_PUSH_AUTH_FAILURE, resolve => {
return (err: string) => resolve(err);
});
export const logout = createAction(LOGOUT_REQUEST);
export const logoutSuccess = createAction(LOGOUT_SUCCESS);
export const logoutFailure = createAction(LOGOUT_FAILURE, resolve => {
return (error: string) => resolve(error);
});

View File

@ -1,223 +0,0 @@
import * as Actions from './actions';
import { ActionType, getType, StateType } from 'typesafe-actions';
import Method2FA from '../../../types/Method2FA';
export type SecondFactorAction = ActionType<typeof Actions>;
interface SecondFactorState {
logoutLoading: boolean;
logoutSuccess: boolean | null;
error: string | null;
userAnotherMethod: boolean;
getAvailableMethodsLoading: boolean;
getAvailableMethodResponse: Method2FA[] | null;
getAvailableMethodError: string | null;
preferedMethodLoading: boolean;
preferedMethodError: string | null;
preferedMethod: Method2FA | null;
setPreferedMethodLoading: boolean;
setPreferedMethodError: string | null;
setPreferedMethodSuccess: boolean | null;
securityKeySupported: boolean;
securityKeySignLoading: boolean;
securityKeySignSuccess: boolean | null;
oneTimePasswordVerificationLoading: boolean,
oneTimePasswordVerificationSuccess: boolean | null,
oneTimePasswordVerificationError: string | null,
duoPushVerificationLoading: boolean;
duoPushVerificationSuccess: boolean | null;
duoPushVerificationError: string | null;
}
const secondFactorInitialState: SecondFactorState = {
logoutLoading: false,
logoutSuccess: null,
error: null,
userAnotherMethod: false,
getAvailableMethodsLoading: false,
getAvailableMethodResponse: null,
getAvailableMethodError: null,
preferedMethod: null,
preferedMethodError: null,
preferedMethodLoading: false,
setPreferedMethodLoading: false,
setPreferedMethodError: null,
setPreferedMethodSuccess: null,
securityKeySupported: false,
securityKeySignLoading: false,
securityKeySignSuccess: null,
oneTimePasswordVerificationLoading: false,
oneTimePasswordVerificationError: null,
oneTimePasswordVerificationSuccess: null,
duoPushVerificationLoading: false,
duoPushVerificationSuccess: null,
duoPushVerificationError: null,
}
export type PortalState = StateType<SecondFactorState>;
export default (state = secondFactorInitialState, action: SecondFactorAction): SecondFactorState => {
switch(action.type) {
case getType(Actions.logout):
return {
...state,
logoutLoading: true,
logoutSuccess: null,
error: null,
};
case getType(Actions.logoutSuccess):
return {
...state,
logoutLoading: false,
logoutSuccess: true,
};
case getType(Actions.logoutFailure):
return {
...state,
logoutLoading: false,
error: action.payload,
}
case getType(Actions.securityKeySign):
return {
...state,
securityKeySignLoading: true,
securityKeySignSuccess: false,
};
case getType(Actions.securityKeySignSuccess):
return {
...state,
securityKeySignLoading: false,
securityKeySignSuccess: true,
};
case getType(Actions.securityKeySignFailure):
return {
...state,
securityKeySignLoading: false,
securityKeySignSuccess: false,
};
case getType(Actions.setSecurityKeySupported):
return {
...state,
securityKeySupported: action.payload,
};
case getType(Actions.oneTimePasswordVerification):
return {
...state,
oneTimePasswordVerificationLoading: true,
oneTimePasswordVerificationError: null,
}
case getType(Actions.oneTimePasswordVerificationSuccess):
return {
...state,
oneTimePasswordVerificationLoading: false,
oneTimePasswordVerificationSuccess: true,
}
case getType(Actions.oneTimePasswordVerificationFailure):
return {
...state,
oneTimePasswordVerificationLoading: false,
oneTimePasswordVerificationError: action.payload,
}
case getType(Actions.getPreferedMethod):
return {
...state,
preferedMethodLoading: true,
preferedMethod: null,
preferedMethodError: null,
}
case getType(Actions.getPreferedMethodSuccess):
return {
...state,
preferedMethodLoading: false,
preferedMethod: action.payload,
}
case getType(Actions.getPreferedMethodFailure):
return {
...state,
preferedMethodLoading: false,
preferedMethodError: action.payload,
}
case getType(Actions.setPreferedMethod):
return {
...state,
setPreferedMethodLoading: true,
setPreferedMethodSuccess: null,
preferedMethodError: null,
}
case getType(Actions.getPreferedMethodSuccess):
return {
...state,
setPreferedMethodLoading: false,
setPreferedMethodSuccess: true,
}
case getType(Actions.getPreferedMethodFailure):
return {
...state,
setPreferedMethodLoading: false,
setPreferedMethodError: action.payload,
}
case getType(Actions.setUseAnotherMethod):
return {
...state,
userAnotherMethod: action.payload,
}
case getType(Actions.triggerDuoPushAuth):
return {
...state,
duoPushVerificationLoading: true,
duoPushVerificationError: null,
duoPushVerificationSuccess: null,
}
case getType(Actions.triggerDuoPushAuthSuccess):
return {
...state,
duoPushVerificationLoading: false,
duoPushVerificationSuccess: true,
}
case getType(Actions.triggerDuoPushAuthFailure):
return {
...state,
duoPushVerificationLoading: false,
duoPushVerificationError: action.payload,
}
case getType(Actions.getPreferedMethod):
return {
...state,
getAvailableMethodsLoading: true,
getAvailableMethodResponse: null,
getAvailableMethodError: null,
}
case getType(Actions.getAvailbleMethodsSuccess):
return {
...state,
getAvailableMethodsLoading: false,
getAvailableMethodResponse: action.payload,
}
case getType(Actions.getAvailbleMethodsFailure):
return {
...state,
getAvailableMethodsLoading: false,
getAvailableMethodError: action.payload,
}
}
return state;
}

View File

@ -1,8 +0,0 @@
import { createAction } from "typesafe-actions";
import { REGISTER_SECURITY_KEY_REQUEST, REGISTER_SECURITY_KEY_SUCCESS, REGISTER_SECURITY_KEY_FAILURE } from "../../constants";
export const registerSecurityKey = createAction(REGISTER_SECURITY_KEY_REQUEST);
export const registerSecurityKeySuccess = createAction(REGISTER_SECURITY_KEY_SUCCESS);
export const registerSecurityKeyFailure = createAction(REGISTER_SECURITY_KEY_FAILURE, resolve => {
return (error: string) => resolve(error);
});

View File

@ -1,36 +0,0 @@
import { ActionType, getType } from "typesafe-actions";
import * as Actions from './actions';
type SecurityKeyRegistrationAction = ActionType<typeof Actions>
export interface SecurityKeyRegistrationState {
error: string | null;
success: boolean | null;
}
let securityKeyRegistrationInitialState: SecurityKeyRegistrationState = {
error: null,
success: null,
}
export default (state = securityKeyRegistrationInitialState, action: SecurityKeyRegistrationAction): SecurityKeyRegistrationState => {
switch(action.type) {
case getType(Actions.registerSecurityKey):
return {
success: null,
error: null,
};
case getType(Actions.registerSecurityKeySuccess):
return {
...state,
success: true,
};
case getType(Actions.registerSecurityKeyFailure):
return {
...state,
success: false,
error: action.payload,
};
}
return state;
}

View File

@ -1,28 +0,0 @@
import { combineReducers } from 'redux';
import FirstFactorReducer from './FirstFactor/reducer';
import SecondFactorReducer from './SecondFactor/reducer';
import OneTimePasswordRegistrationReducer from './OneTimePasswordRegistration/reducer';
import SecurityKeyRegistrationReducer from './SecurityKeyRegistration/reducer';
import AuthenticationReducer from './Authentication/reducer';
import ForgotPasswordReducer from './ForgotPassword/reducer';
import ResetPasswordReducer from './ResetPassword/reducer';
import { connectRouter } from 'connected-react-router'
import { History } from 'history';
function reducer(history: History) {
return combineReducers({
router: connectRouter(history),
authentication: AuthenticationReducer,
firstFactor: FirstFactorReducer,
secondFactor: SecondFactorReducer,
oneTimePasswordRegistration: OneTimePasswordRegistrationReducer,
securityKeyRegistration: SecurityKeyRegistrationReducer,
forgotPassword: ForgotPasswordReducer,
resetPassword: ResetPasswordReducer,
});
}
export default reducer;

View File

@ -1,64 +0,0 @@
export const FETCH_STATE_REQUEST = '@portal/fetch_state_request';
export const FETCH_STATE_SUCCESS = '@portal/fetch_state_success';
export const FETCH_STATE_FAILURE = '@portal/fetch_state_failure';
// AUTHENTICATION PROCESS
export const FIRST_FACTOR_SET_USERNAME = "@portal/first_factor/set_username";
export const FIRST_FACTOR_SET_PASSWORD = "@portal/first_factor/set_password";
export const AUTHENTICATE_REQUEST = '@portal/first_factor/authenticate_request';
export const AUTHENTICATE_SUCCESS = '@portal/first_factor/authenticate_success';
export const AUTHENTICATE_FAILURE = '@portal/first_factor/authenticate_failure';
// SECOND FACTOR PAGE
export const SET_SECURITY_KEY_SUPPORTED = '@portal/second_factor/set_security_key_supported';
export const SET_USE_ANOTHER_METHOD = '@portal/second_factor/set_use_another_method';
export const GET_AVAILABLE_METHODS = '@portal/second_factor/get_available_methods';
export const GET_AVAILABLE_METHODS_SUCCESS = '@portal/second_factor/get_available_methods_success';
export const GET_AVAILABLE_METHODS_FAILURE = '@portal/second_factor/get_available_methods_failure';
export const GET_PREFERED_METHOD = '@portal/second_factor/get_prefered_method';
export const GET_PREFERED_METHOD_SUCCESS = '@portal/second_factor/get_prefered_method_success';
export const GET_PREFERED_METHOD_FAILURE = '@portal/second_factor/get_prefered_method_failure';
export const SET_PREFERED_METHOD = '@portal/second_factor/set_prefered_method';
export const SET_PREFERED_METHOD_SUCCESS = '@portal/second_factor/set_prefered_method_success';
export const SET_PREFERED_METHOD_FAILURE = '@portal/second_factor/set_prefered_method_failure';
export const SECURITY_KEY_SIGN = '@portal/second_factor/security_key_sign';
export const SECURITY_KEY_SIGN_SUCCESS = '@portal/second_factor/security_key_sign_success';
export const SECURITY_KEY_SIGN_FAILURE = '@portal/second_factor/security_key_sign_failure';
export const ONE_TIME_PASSWORD_VERIFICATION_REQUEST = '@portal/second_factor/one_time_password_verification_request';
export const ONE_TIME_PASSWORD_VERIFICATION_SUCCESS = '@portal/second_factor/one_time_password_verification_success';
export const ONE_TIME_PASSWORD_VERIFICATION_FAILURE = '@portal/second_factor/one_time_password_verification_failure';
export const TRIGGER_DUO_PUSH_AUTH = '@portal/second_factor/trigger_duo_push_auth_request';
export const TRIGGER_DUO_PUSH_AUTH_SUCCESS = '@portal/second_factor/trigger_duo_push_auth_request_success';
export const TRIGGER_DUO_PUSH_AUTH_FAILURE = '@portal/second_factor/trigger_duo_push_auth_request_failure';
export const LOGOUT_REQUEST = '@portal/logout_request';
export const LOGOUT_SUCCESS = '@portal/logout_success';
export const LOGOUT_FAILURE = '@portal/logout_failure';
// TOTP REGISTRATION
export const GENERATE_TOTP_SECRET_REQUEST = '@portal/generate_totp_secret_request';
export const GENERATE_TOTP_SECRET_SUCCESS = '@portal/generate_totp_secret_success';
export const GENERATE_TOTP_SECRET_FAILURE = '@portal/generate_totp_secret_failure';
// U2F REGISTRATION
export const REGISTER_SECURITY_KEY_REQUEST = '@portal/security_key_registration/register_request';
export const REGISTER_SECURITY_KEY_SUCCESS = '@portal/security_key_registration/register_success';
export const REGISTER_SECURITY_KEY_FAILURE = '@portal/security_key_registration/register_failed';
// FORGOT PASSWORD
export const FORGOT_PASSWORD_REQUEST = '@portal/forgot_password/forgot_password_request';
export const FORGOT_PASSWORD_SUCCESS = '@portal/forgot_password/forgot_password_success';
export const FORGOT_PASSWORD_FAILURE = '@portal/forgot_password/forgot_password_failure';
// FORGOT PASSWORD
export const RESET_PASSWORD_REQUEST = '@portal/forgot_password/reset_password_request';
export const RESET_PASSWORD_SUCCESS = '@portal/forgot_password/reset_password_success';
export const RESET_PASSWORD_FAILURE = '@portal/forgot_password/reset_password_failure';

View File

@ -1,12 +0,0 @@
import PortalReducer from './Portal';
import { StateType } from 'typesafe-actions';
function getReturnType<R> (f: (...args: any[]) => R): R {
return null!;
}
const t = getReturnType(PortalReducer)
export type RootState = StateType<typeof t>;
export default PortalReducer;

View File

@ -1,6 +0,0 @@
import PortalLayout from "../containers/layouts/PortalLayout/PortalLayout";
export const routes = [{
path: '/',
component: PortalLayout
}];

View File

@ -1,37 +0,0 @@
import ConfirmationSentView from "../views/ConfirmationSentView/ConfirmationSentView";
import OneTimePasswordRegistrationView from "../containers/views/OneTimePasswordRegistrationView/OneTimePasswordRegistrationView";
import SecurityKeyRegistrationView from "../containers/views/SecurityKeyRegistrationView/SecurityKeyRegistrationView";
import ForgotPasswordView from "../containers/views/ForgotPasswordView/ForgotPasswordView";
import ResetPasswordView from "../containers/views/ResetPasswordView/ResetPasswordView";
import AuthenticationView from "../containers/views/AuthenticationView/AuthenticationView";
import LogoutView from "../containers/views/LogoutView/LogoutView";
export const routes = [{
path: '/',
title: 'Sign in',
component: AuthenticationView,
}, {
path: '/confirmation-sent',
title: 'e-mail sent',
component: ConfirmationSentView
}, {
path: '/one-time-password-registration',
title: 'One-time password',
component: OneTimePasswordRegistrationView,
}, {
path: '/security-key-registration',
title: 'Security key',
component: SecurityKeyRegistrationView,
}, {
path: '/forgot-password',
title: 'Forgot password',
component: ForgotPasswordView,
}, {
path: '/reset-password',
title: 'Reset password',
component: ResetPasswordView,
}, {
path: '/logout',
title: 'Logout',
component: LogoutView,
}]

View File

@ -1,135 +0,0 @@
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read http://bit.ly/CRA-PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export function register(config: any) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit http://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl: any, config: any) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See http://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl: any, config: any) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl)
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}

View File

@ -1,243 +0,0 @@
import RemoteState from "../views/AuthenticationView/RemoteState";
import U2fApi from "u2f-api";
import Method2FA from "../types/Method2FA";
import { string } from "prop-types";
interface DataResponse<T> {
status: "OK";
data: T;
}
interface ErrorResponse {
status: "KO";
message: string;
}
type ServiceResponse<T> = DataResponse<T> | ErrorResponse;
class AutheliaService {
static async fetchSafeJson<T>(url: string, options?: RequestInit): Promise<T> {
const res = await fetch(url, options);
if (res.status !== 200) {
throw new Error('Status code ' + res.status);
}
const response: ServiceResponse<T> = await res.json();
if (response.status == "OK") {
return response.data;
} else {
throw new Error(response.message)
}
}
/**
* Fetch current authentication state.
*/
static async fetchState(): Promise<RemoteState> {
return await this.fetchSafeJson<RemoteState>('/api/state')
}
static async postFirstFactorAuth(username: string, password: string,
rememberMe: boolean, targetURL: string | null) {
const headers: Record<string, string> = {
'Accept': 'application/json',
'Content-Type': 'application/json',
}
const requestBody: {
username: string,
password: string,
keepMeLoggedIn: boolean,
targetURL?: string
} = {
username: username,
password: password,
keepMeLoggedIn: rememberMe,
}
if (targetURL) {
requestBody.targetURL = targetURL;
}
return this.fetchSafeJson<{redirect: string}|undefined>('/api/firstfactor', {
method: 'POST',
headers: headers,
body: JSON.stringify(requestBody)
});
}
static async postLogout() {
return this.fetchSafeJson<undefined>('/api/logout', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
})
}
static async startU2FRegistrationIdentityProcess() {
return this.fetchSafeJson<undefined>('/api/secondfactor/u2f/identity/start', {
method: 'POST',
});
}
static async startTOTPRegistrationIdentityProcess() {
return this.fetchSafeJson<undefined>('/api/secondfactor/totp/identity/start', {
method: 'POST',
});
}
static async requestSigning() {
return this.fetchSafeJson<{
appId: string,
challenge: string,
registeredKeys: {
appId: string,
keyHandle: string,
version: string,
}[]
}>('/api/secondfactor/u2f/sign_request', {
method: 'POST'
});
}
static async completeSecurityKeySigning(
response: U2fApi.SignResponse, targetURL: string | null) {
const headers: Record<string, string> = {'Content-Type': 'application/json',}
const requestBody: {signResponse: U2fApi.SignResponse, targetURL?: string} = {
signResponse: response,
};
if (targetURL) {
requestBody.targetURL = targetURL;
}
return this.fetchSafeJson<{redirect: string}|undefined>('/api/secondfactor/u2f/sign', {
method: 'POST',
headers: headers,
body: JSON.stringify(requestBody),
});
}
static async verifyTotpToken(
token: string, targetURL: string | null) {
const headers: Record<string, string> = {
'Content-Type': 'application/json',
}
var requestBody: {token: string, targetURL?: string} = {token};
if (targetURL) {
requestBody.targetURL = targetURL;
}
return this.fetchSafeJson<{redirect: string}|undefined>('/api/secondfactor/totp', {
method: 'POST',
headers: headers,
body: JSON.stringify(requestBody),
})
}
static async triggerDuoPush(targetURL: string | null): Promise<{redirect: string}|undefined> {
const headers: Record<string, string> = {
'Content-Type': 'application/json',
}
const requestBody: {targetURL?: string} = {}
if (targetURL) {
requestBody.targetURL = targetURL;
}
return this.fetchSafeJson<{redirect: string}|undefined>('/api/secondfactor/duo', {
method: 'POST',
headers: headers,
body: JSON.stringify(requestBody),
});
}
static async initiatePasswordResetIdentityValidation(username: string) {
return this.fetchSafeJson<undefined>('/api/reset-password/identity/start', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({username})
});
}
static async completePasswordResetIdentityValidation(token: string) {
return this.fetchSafeJson<undefined>(`/api/reset-password/identity/finish`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({token})
});
}
static async resetPassword(newPassword: string) {
return this.fetchSafeJson<undefined>('/api/reset-password', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({password: newPassword})
});
}
static async fetchPrefered2faMethod(): Promise<Method2FA> {
const res = await this.fetchSafeJson<{method: Method2FA}>('/api/secondfactor/preferences');
return res.method;
}
static async setPrefered2faMethod(method: Method2FA): Promise<void> {
return this.fetchSafeJson<undefined>('/api/secondfactor/preferences', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({method})
});
}
static async getAvailable2faMethods(): Promise<Method2FA[]> {
return this.fetchSafeJson('/api/secondfactor/available');
}
static async completeSecurityKeyRegistration(
response: U2fApi.RegisterResponse): Promise<undefined> {
return this.fetchSafeJson('/api/secondfactor/u2f/register', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify(response),
});
}
static async completeSecurityKeyRegistrationIdentityValidation(token: string) {
return this.fetchSafeJson<{
appId: string,
registerRequests: [{
version: string,
challenge: string,
}]
}>(`/api/secondfactor/u2f/identity/finish`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({token})
});
}
static async completeOneTimePasswordRegistrationIdentityValidation(token: string) {
return this.fetchSafeJson<{base32_secret: string, otpauth_url: string}>(`/api/secondfactor/totp/identity/finish`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({token})
});
}
}
export default AutheliaService;

View File

@ -1,7 +0,0 @@
import Method2FA from "../types/Method2FA";
export default interface PreferedMethodResponse {
method?: Method2FA;
error?: string;
}

View File

@ -1,7 +0,0 @@
enum AuthenticationLevel {
NOT_AUTHENTICATED = 0,
ONE_FACTOR = 1,
TWO_FACTOR = 2
};
export default AuthenticationLevel;

View File

@ -1,4 +0,0 @@
type Method2FA = "u2f" | "totp" | "duo_push";
export default Method2FA;

View File

@ -1,49 +0,0 @@
import React, { Component } from "react";
import AlreadyAuthenticated from "../../containers/components/AlreadyAuthenticated/AlreadyAuthenticated";
import FirstFactorForm from "../../containers/components/FirstFactorForm/FirstFactorForm";
import SecondFactorForm from "../../containers/components/SecondFactorForm/SecondFactorForm";
import RemoteState from "./RemoteState";
import { RouterProps, RouteProps } from "react-router";
export enum Stage {
FIRST_FACTOR,
SECOND_FACTOR,
ALREADY_AUTHENTICATED,
}
export interface OwnProps extends RouteProps {}
export interface StateProps {
stage: Stage;
remoteState: RemoteState | null;
redirectionUrl: string | null;
}
export interface DispatchProps {
onInit: () => void;
}
export type Props = StateProps & DispatchProps & RouterProps;
class AuthenticationView extends Component<Props> {
componentWillMount() {
this.props.onInit();
}
render() {
if (!this.props.remoteState) return null;
if (this.props.stage === Stage.SECOND_FACTOR) {
return <SecondFactorForm
username={this.props.remoteState.username}
redirectionUrl={this.props.redirectionUrl} />;
} else if (this.props.stage === Stage.ALREADY_AUTHENTICATED) {
return <AlreadyAuthenticated
username={this.props.remoteState.username}
redirectionUrl={this.props.redirectionUrl} />;
}
return <FirstFactorForm redirectionUrl={this.props.redirectionUrl} />;
}
}
export default AuthenticationView;

View File

@ -1,10 +0,0 @@
import AuthenticationLevel from '../../types/AuthenticationLevel';
interface RemoteState {
username: string;
authentication_level: AuthenticationLevel;
default_redirection_url: string;
method: 'u2f' | 'totp'
}
export default RemoteState;

View File

@ -1,36 +0,0 @@
import React, { Component } from "react";
import classnames from 'classnames';
import mail from '../../assets/images/mail.png';
import styles from '../../assets/scss/views/ConfirmationSentView/ConfirmationSentView.module.scss';
import Button from "@material/react-button";
import { RouterProps } from "react-router";
interface Props extends RouterProps {}
class ConfirmationSentView extends Component<Props> {
render() {
return (
<div className={styles.main}>
<div className={classnames(styles.image, styles.left)}>
<img src={mail} alt="mail" />
</div>
<div className={styles.right}>
Please check your e-mails and follow the instructions to confirm the operation.
<div className={styles.buttonContainer}>
<Button
onClick={() => this.props.history.goBack()}
className={styles.button}
raised={true}
color="primary">
Back
</Button>
</div>
</div>
</div>
)
}
}
export default ConfirmationSentView;

View File

@ -1,92 +0,0 @@
import React, { Component, KeyboardEvent, FormEvent } from "react";
import classnames from 'classnames';
import Button from "@material/react-button";
import TextField, { Input } from "@material/react-text-field";
import styles from '../../assets/scss/views/ForgotPasswordView/ForgotPasswordView.module.scss';
export interface StateProps {
disabled: boolean;
}
export interface DispatchProps {
onPasswordResetRequested: (username: string) => void;
onCancelClicked: () => void;
}
export type Props = StateProps & DispatchProps;
interface State {
username: string;
}
class ForgotPasswordView extends Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
username: '',
}
}
private onUsernameChanged = (e: FormEvent<HTMLElement>) => {
this.setState({username: (e.target as HTMLInputElement).value});
}
private onKeyPressed = (e: KeyboardEvent) => {
if (e.key == 'Enter') {
this.onPasswordResetRequested();
}
}
private onPasswordResetRequested = () => {
if (this.state.username.length == 0) return;
this.props.onPasswordResetRequested(this.state.username);
}
render() {
return (
<div>
<div>What's your username?</div>
<div className={styles.form}>
<TextField
className={styles.field}
outlined={true}
label="Username">
<Input
id="username"
name="username"
onChange={this.onUsernameChanged}
onKeyPress={this.onKeyPressed}
value={this.state.username}
disabled={this.props.disabled} />
</TextField>
<div className={styles.buttonsContainer}>
<div className={classnames(styles.buttonContainer, styles.buttonConfirmContainer)}>
<Button
onClick={this.onPasswordResetRequested}
color="primary"
id="next-button"
raised={true}
className={styles.buttonConfirm}
disabled={this.props.disabled}>
Next
</Button>
</div>
<div className={classnames(styles.buttonContainer, styles.buttonCancelContainer)}>
<Button
onClick={this.props.onCancelClicked}
color="primary"
raised={true}
id="cancel-button"
className={styles.buttonCancel}>
Cancel
</Button>
</div>
</div>
</div>
</div>
);
}
}
export default ForgotPasswordView;

View File

@ -1,18 +0,0 @@
import React from "react"
import { Redirect } from "react-router";
export interface DispatchProps {
onInit: () => void;
}
type Props = DispatchProps;
export default class LogoutView extends React.Component<Props> {
componentWillMount() {
this.props.onInit();
}
render() {
return <Redirect to='/' />;
}
}

Some files were not shown because too many files have changed in this diff Show More