You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/gogather/oauth

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/gogather/oauth

v0.0.0-20141222080958-c542a137ff3d
Source
Go
Version published
Created
Source

oauth

github

package controllers

import (
	"github.com/astaxie/beego"
	"github.com/gogather/oauth"
)

type OAuthController struct {
	BaseController
}

func (this *OAuthController) Get() {
	code := this.GetString("code")
	clientId := beego.AppConfig.String("github_client_id")
	clientSecret := beego.AppConfig.String("github_client_secret")

	oauthGithub := &oauth.GithubOAuth{}
	json, err := oauthGithub.GetData(clientId, clientSecret, code)

	if err != nil {
		this.Ctx.WriteString("Response Error! ")
		return
	}
	data := json.(map[string]interface{})

	this.Data["login"] = data["login"].(string)
	this.Data["avatar_url"] = data["avatar_url"].(string)
	this.Data["name"] = data["name"].(string)

	this.TplNames = "user/oauth.tpl"
}

FAQs

Package last updated on 22 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts