Get username from roblox API rather than manually passing it
This commit is contained in:
parent
b846ebe575
commit
85aadb514b
@ -15,7 +15,7 @@ type Session struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// New create a new session and logs in with provided data
|
// New create a new session and logs in with provided data
|
||||||
func New(username, cookie string) (*Session, error) {
|
func New(cookie string) (*Session, error) {
|
||||||
cookieJar, _ := cookiejar.New(nil)
|
cookieJar, _ := cookiejar.New(nil)
|
||||||
rbxCookie := []*http.Cookie{&http.Cookie{
|
rbxCookie := []*http.Cookie{&http.Cookie{
|
||||||
Name: ".ROBLOSECURITY",
|
Name: ".ROBLOSECURITY",
|
||||||
@ -28,7 +28,7 @@ func New(username, cookie string) (*Session, error) {
|
|||||||
Jar: cookieJar,
|
Jar: cookieJar,
|
||||||
}
|
}
|
||||||
|
|
||||||
session := Session{0, username, client}
|
session := Session{0, "", client}
|
||||||
|
|
||||||
/*err := session.Login(username, password)
|
/*err := session.Login(username, password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -41,6 +41,7 @@ func New(username, cookie string) (*Session, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
session.ID = info.UserID
|
session.ID = info.UserID
|
||||||
|
session.Username = info.UserName
|
||||||
|
|
||||||
return &session, err
|
return &session, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user