mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 18:29:08 +00:00
sync
This commit is contained in:
parent
7dd7c170b4
commit
86a222fb98
20 changed files with 291 additions and 46 deletions
27
UI/src/components/oauth-bot-flow/index.js
Normal file
27
UI/src/components/oauth-bot-flow/index.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
import React, { Component } from 'react'
|
||||
import { Redirect } from 'react-router-dom'
|
||||
import superagent from 'superagent'
|
||||
import { connect } from 'react-redux'
|
||||
import { push } from 'react-router-redux'
|
||||
import { fetchServers } from '../../actions'
|
||||
|
||||
@connect()
|
||||
class OauthCallback extends Component {
|
||||
state = {
|
||||
notReady: true,
|
||||
message: 'chotto matte kudasai...',
|
||||
url: null
|
||||
}
|
||||
|
||||
async componentDidMount () {
|
||||
const { body: { url } } = await superagent.get('/api/oauth/bot?url=✔️')
|
||||
this.setState({ url, notReady: false })
|
||||
window.location.href = url
|
||||
}
|
||||
|
||||
render () {
|
||||
return (this.state.notReady) ? this.state.message : <a style={{zIndex: 10000}} href={this.state.url}>Something oopsed, click me to get to where you meant.</a>
|
||||
}
|
||||
}
|
||||
|
||||
export default OauthCallback
|
Loading…
Add table
Add a link
Reference in a new issue