Move login to oauth.
This commit is contained in:
parent
7f0e140a4f
commit
9af204b293
12 changed files with 1332 additions and 243 deletions
20
src/components/oauth_callback/oauth_callback.js
Normal file
20
src/components/oauth_callback/oauth_callback.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
import oauth from '../../services/new_api/oauth.js'
|
||||
|
||||
const oac = {
|
||||
props: ['code'],
|
||||
mounted () {
|
||||
if (this.code) {
|
||||
oauth.getToken({
|
||||
app: this.$store.state.oauth,
|
||||
instance: this.$store.state.instance.server,
|
||||
code: this.code
|
||||
}).then((result) => {
|
||||
this.$store.commit("setToken", result.access_token)
|
||||
this.$store.dispatch("loginUser", result.access_token)
|
||||
this.$router.push('/main/friends')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default oac
|
Loading…
Add table
Add a link
Reference in a new issue