<commit_before>package uic

import (
	"github.com/Cepave/fe/http/base"
	"github.com/Cepave/fe/model/uic"
	"github.com/Cepave/fe/utils"
)

type SsoController struct {
	base.BaseController
}

func (this *SsoController) Sig() {
	this.Ctx.Output.Body([]byte(utils.GenerateUUID()))
}

func (this *SsoController) User() {
	sig := this.Ctx.Input.Param(":sig")
	if sig == "" {
		this.NotFound("sig is blank")
		return
	}

	s := uic.ReadSessionBySig(sig)
	if s == nil {
		this.NotFound("no such sig")
		return
	}

	u := uic.ReadUserById(s.Uid)
	if u == nil {
		this.NotFound("no such user")
		return
	}

	this.Data["json"] = map[string]interface{}{
		"user": u,
	}
	this.ServeJson()
}

func (this *SsoController) Logout() {
	sig := this.Ctx.Input.Param(":sig")
	if sig == "" {
		this.ServeErrJson("sig is blank")
		return
	}

	s := uic.ReadSessionBySig(sig)
	if s != nil {
		uic.RemoveSessionByUid(s.Uid)
	}

	this.ServeOKJson()
}<commit_msg>Change the variable's name<commit_after>package uic

import (
	"github.com/Cepave/fe/http/base"
	"github.com/Cepave/fe/model/uic"
	"github.com/Cepave/fe/utils"
)

type SsoController struct {
	base.BaseController
}

func (this *SsoController) Sig() {
	this.Ctx.Output.Body([]byte(utils.GenerateUUID()))
}

func (this *SsoController) User() {
	sig := this.Ctx.Input.Param(":sig")
	if sig == "" {
		this.NotFound("sig is blank")
		return
	}

	sessionObj := uic.ReadSessionBySig(sig)
	if sessionObj == nil {
		this.NotFound("no such sig")
		return
	}

	u := uic.ReadUserById(sessionObj.Uid)
	if u == nil {
		this.NotFound("no such user")
		return
	}

	this.Data["json"] = map[string]interface{}{
		"user": u,
	}
	this.ServeJson()
}

func (this *SsoController) Logout() {
	sig := this.Ctx.Input.Param(":sig")
	if sig == "" {
		this.ServeErrJson("sig is blank")
		return
	}

	sessionObj := uic.ReadSessionBySig(sig)
	if sessionObj != nil {
		uic.RemoveSessionByUid(s.Uid)
	}

	this.ServeOKJson()
}
{'fraction_non_alphanumeric': 0.1741164241164241, 'fraction_numerical': 0.0, 'mean_word_length': 3.9107142857142856, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5494157', 'n_tokens_mistral': 807, 'n_tokens_neox': 782, 'n_words': 141}