mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-22 23:13:00 +00:00
Remove unused session ID field
This commit is contained in:
parent
c7f40c1e15
commit
927072e26a
@ -1,7 +1,6 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
type Session struct {
|
type Session struct {
|
||||||
ID string `json:"id,omitempty"`
|
|
||||||
UserID string `json:"uid,omitempty"`
|
UserID string `json:"uid,omitempty"`
|
||||||
Instance string `json:"ins,omitempty"`
|
Instance string `json:"ins,omitempty"`
|
||||||
ClientID string `json:"cid,omitempty"`
|
ClientID string `json:"cid,omitempty"`
|
||||||
|
@ -840,10 +840,6 @@ func (s *service) NewSession(c *client, instance string) (rurl string, sess *mod
|
|||||||
instanceURL = "https://" + instance
|
instanceURL = "https://" + instance
|
||||||
}
|
}
|
||||||
|
|
||||||
sid, err := util.NewSessionID()
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
csrf, err := util.NewCSRFToken()
|
csrf, err := util.NewCSRFToken()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -861,7 +857,6 @@ func (s *service) NewSession(c *client, instance string) (rurl string, sess *mod
|
|||||||
}
|
}
|
||||||
rurl = app.AuthURI
|
rurl = app.AuthURI
|
||||||
sess = &model.Session{
|
sess = &model.Session{
|
||||||
ID: sid,
|
|
||||||
Instance: instance,
|
Instance: instance,
|
||||||
ClientID: app.ClientID,
|
ClientID: app.ClientID,
|
||||||
ClientSecret: app.ClientSecret,
|
ClientSecret: app.ClientSecret,
|
||||||
|
@ -16,10 +16,6 @@ func NewRandID(n int) (string, error) {
|
|||||||
return enc.EncodeToString(data), nil
|
return enc.EncodeToString(data), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSessionID() (string, error) {
|
|
||||||
return NewRandID(24)
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCSRFToken() (string, error) {
|
func NewCSRFToken() (string, error) {
|
||||||
return NewRandID(24)
|
return NewRandID(24)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user