示例#1
0
func (old *AuthorizeData) transfer() *osin.AuthorizeData {
	var authorizeData osin.AuthorizeData = osin.AuthorizeData{}
	authorizeData.Client = &old.Client
	authorizeData.Code = old.Code
	authorizeData.ExpiresIn = old.ExpiresIn
	authorizeData.Scope = old.Scope
	authorizeData.RedirectUri = old.RedirectUri
	authorizeData.State = old.State
	authorizeData.CreatedAt = old.CreatedAt
	authorizeData.UserData = old.UserData
	return &authorizeData
}
示例#2
0
func (store *MongoStorage) createAuthorizeData(copyFrom *AuthorizeData, osinData *osin.AuthorizeData) *osin.AuthorizeData {
	osinData.Code = copyFrom.Code
	osinData.ExpiresIn = copyFrom.ExpiresIn
	osinData.Scope = copyFrom.Scope
	osinData.RedirectUri = copyFrom.RedirectUri
	osinData.State = copyFrom.State
	osinData.CreatedAt = copyFrom.CreatedAt
	osinData.UserData = copyFrom.UserData

	client, err := store.GetClientWithUserData(copyFrom.UserData)
	if err != nil || client == nil {
		osinData.Client = &osin.DefaultClient{}
	} else {
		osinData.Client = client
	}

	return osinData
}