Skip to content

Manage Users and Sessions

Fabian Wenzelmann edited this page Mar 24, 2017 · 4 revisions

If you've read everything from before you should be well prepared. Simply use uint64 for UserKeyType, to do this make sure to create a SQLSessionHandler with ForceUIDuint. For example like this:

func MyPostgresSessionController(db *sql.DB, tableName, userIDType string) *goauth.SessionController {
	if userIDType == "" {
		userIDType = "BIGINT NOT NULL"
	}
	handler := goauth.NewSQLSessionHandler(db, goauth.NewPostgresSessionTemplate(), tableName, userIDType, false)
	handler.ForceUIDuint = true
	return goauth.NewSessionController(handler)
}

Everything should work fine...

Clone this wiki locally

⌂ 换网址