'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _regenerator = require('babel-runtime/regenerator');

var _regenerator2 = _interopRequireDefault(_regenerator);

var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');

var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);

var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _head = require('next/dist/lib/head.js');

var _head2 = _interopRequireDefault(_head);

var _link = require('next/dist/lib/link.js');

var _link2 = _interopRequireDefault(_link);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _jsxFileName = '/Users/iain/Development/next-auth/example/pages/auth/error.js?entry';


var _class = function (_React$Component) {
  (0, _inherits3.default)(_class, _React$Component);

  function _class() {
    (0, _classCallCheck3.default)(this, _class);

    return (0, _possibleConstructorReturn3.default)(this, (_class.__proto__ || (0, _getPrototypeOf2.default)(_class)).apply(this, arguments));
  }

  (0, _createClass3.default)(_class, [{
    key: 'render',
    value: function render() {
      if (this.props.action == 'signin' && this.props.type == 'oauth' && this.props.service) {
        return _react2.default.createElement('div', { className: 'container', __source: {
            fileName: _jsxFileName,
            lineNumber: 18
          }
        }, _react2.default.createElement(_head2.default, {
          __source: {
            fileName: _jsxFileName,
            lineNumber: 19
          }
        }, _react2.default.createElement('link', { rel: 'stylesheet', href: 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css', integrity: 'sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm', crossOrigin: 'anonymous', __source: {
            fileName: _jsxFileName,
            lineNumber: 20
          }
        })), _react2.default.createElement('div', { className: 'text-center', __source: {
            fileName: _jsxFileName,
            lineNumber: 22
          }
        }, _react2.default.createElement('h1', { className: 'display-4 mt-5 mb-3', __source: {
            fileName: _jsxFileName,
            lineNumber: 23
          }
        }, 'Unable to sign in with ', this.props.service), _react2.default.createElement('p', { className: 'lead', __source: {
            fileName: _jsxFileName,
            lineNumber: 24
          }
        }, 'An account associated with your email address already exists.'), _react2.default.createElement('p', { className: 'lead', __source: {
            fileName: _jsxFileName,
            lineNumber: 25
          }
        }, _react2.default.createElement(_link2.default, { href: '/auth', __source: {
            fileName: _jsxFileName,
            lineNumber: 25
          }
        }, _react2.default.createElement('a', {
          __source: {
            fileName: _jsxFileName,
            lineNumber: 25
          }
        }, 'Sign in with email or another service.')))), _react2.default.createElement('div', { className: 'row', __source: {
            fileName: _jsxFileName,
            lineNumber: 27
          }
        }, _react2.default.createElement('div', { className: 'col-sm-8 mr-auto ml-auto', __source: {
            fileName: _jsxFileName,
            lineNumber: 28
          }
        }, _react2.default.createElement('div', { className: 'card m-3 text-muted', __source: {
            fileName: _jsxFileName,
            lineNumber: 29
          }
        }, _react2.default.createElement('div', { className: 'card-body', __source: {
            fileName: _jsxFileName,
            lineNumber: 30
          }
        }, _react2.default.createElement('h4', {
          __source: {
            fileName: _jsxFileName,
            lineNumber: 31
          }
        }, 'Why am I seeing this?'), _react2.default.createElement('p', { className: 'mb-1', __source: {
            fileName: _jsxFileName,
            lineNumber: 32
          }
        }, 'It looks like you might have already signed up using another service.'), _react2.default.createElement('p', { className: 'mb-0', __source: {
            fileName: _jsxFileName,
            lineNumber: 35
          }
        }, 'To sign in with ', this.props.service, ', first sign in using your email address then link accounts.'))))));
      } else if (this.props.action == 'signin' && this.props.type == 'token-invalid') {
        return _react2.default.createElement('div', { className: 'container', __source: {
            fileName: _jsxFileName,
            lineNumber: 46
          }
        }, _react2.default.createElement(_head2.default, {
          __source: {
            fileName: _jsxFileName,
            lineNumber: 47
          }
        }, _react2.default.createElement('link', { rel: 'stylesheet', href: 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css', integrity: 'sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm', crossOrigin: 'anonymous', __source: {
            fileName: _jsxFileName,
            lineNumber: 48
          }
        })), _react2.default.createElement('div', { className: 'text-center', __source: {
            fileName: _jsxFileName,
            lineNumber: 50
          }
        }, _react2.default.createElement('h1', { className: 'display-4 mt-5 mb-2', __source: {
            fileName: _jsxFileName,
            lineNumber: 51
          }
        }, 'Sign in link not valid'), _react2.default.createElement('p', { className: 'lead', __source: {
            fileName: _jsxFileName,
            lineNumber: 52
          }
        }, 'The sign in link you used is no longer valid.'), _react2.default.createElement('p', { className: 'lead', __source: {
            fileName: _jsxFileName,
            lineNumber: 53
          }
        }, _react2.default.createElement(_link2.default, { href: '/auth', __source: {
            fileName: _jsxFileName,
            lineNumber: 53
          }
        }, _react2.default.createElement('a', {
          __source: {
            fileName: _jsxFileName,
            lineNumber: 53
          }
        }, 'Get a new sign in link.')))));
      } else {
        return _react2.default.createElement('div', { className: 'container', __source: {
            fileName: _jsxFileName,
            lineNumber: 59
          }
        }, _react2.default.createElement(_head2.default, {
          __source: {
            fileName: _jsxFileName,
            lineNumber: 60
          }
        }, _react2.default.createElement('link', { rel: 'stylesheet', href: 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css', integrity: 'sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm', crossOrigin: 'anonymous', __source: {
            fileName: _jsxFileName,
            lineNumber: 61
          }
        })), _react2.default.createElement('div', { className: 'text-center', __source: {
            fileName: _jsxFileName,
            lineNumber: 63
          }
        }, _react2.default.createElement('h1', { className: 'display-4 mt-5', __source: {
            fileName: _jsxFileName,
            lineNumber: 64
          }
        }, 'Error signing in'), _react2.default.createElement('p', { className: 'lead', __source: {
            fileName: _jsxFileName,
            lineNumber: 65
          }
        }, 'An error occured while trying to sign in.'), _react2.default.createElement('p', {
          __source: {
            fileName: _jsxFileName,
            lineNumber: 66
          }
        }, _react2.default.createElement(_link2.default, { href: '/', __source: {
            fileName: _jsxFileName,
            lineNumber: 67
          }
        }, _react2.default.createElement('a', {
          __source: {
            fileName: _jsxFileName,
            lineNumber: 67
          }
        }, 'Home')))));
      }
    }
  }], [{
    key: 'getInitialProps',
    value: function () {
      var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(_ref) {
        var query = _ref.query;
        return _regenerator2.default.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                return _context.abrupt('return', {
                  action: query.action || null,
                  type: query.type || null,
                  service: query.service || null
                });

              case 1:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, this);
      }));

      function getInitialProps(_x) {
        return _ref2.apply(this, arguments);
      }

      return getInitialProps;
    }()
  }]);

  return _class;
}(_react2.default.Component);

exports.default = _class;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhZ2VzL2F1dGgvZXJyb3IuanMiXSwibmFtZXMiOlsiUmVhY3QiLCJIZWFkIiwiTGluayIsInByb3BzIiwiYWN0aW9uIiwidHlwZSIsInNlcnZpY2UiLCJxdWVyeSIsIkNvbXBvbmVudCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLEFBQU87Ozs7QUFDUCxBQUFPOzs7O0FBQ1AsQUFBTzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7NkJBW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