Telegram auth (wip)
This commit is contained in:
parent
5fe60d20d3
commit
58c54e5b94
7 changed files with 92 additions and 9 deletions
48
imports/ui/pages/Auth/Auth.js
Normal file
48
imports/ui/pages/Auth/Auth.js
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/* eslint-disable react/jsx-indent-props */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { translate } from 'react-i18next';
|
||||
import { Bert } from 'meteor/themeteorchef:bert';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { T9n } from 'meteor-accounts-t9n';
|
||||
import { Accounts } from 'meteor/accounts-base';
|
||||
|
||||
class Auth extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const { token } = props.match.params;
|
||||
// console.log(token);
|
||||
console.log(Meteor.connection);
|
||||
console.log(Accounts.connection);
|
||||
|
||||
Meteor.loginWithToken(token, (error) => {
|
||||
// this is going to throw error if we logged out
|
||||
if (error) {
|
||||
Bert.alert(T9n.get(`error.accounts.${error.reason}`), 'danger');
|
||||
// props.history.push('/login');
|
||||
} else {
|
||||
console.log('loginWithToken');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Auth.propTypes = {
|
||||
// t: PropTypes.func.isRequired,
|
||||
history: PropTypes.object.isRequired,
|
||||
match: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
Auth.defaultProps = {
|
||||
};
|
||||
|
||||
export default translate([], { wait: true })(Auth);
|
||||
Loading…
Add table
Add a link
Reference in a new issue