# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1580925380 0
# Node ID de90b2f5da8c8c1689dc3444c5d72c52a6b2c611
# Parent  85f1cbfd364a0feca6fef8880f6cc4d9b7e05ee3
sessionmanager: Support passing an auth scope to make_authenticated

diff -r 85f1cbfd364a -r de90b2f5da8c core/sessionmanager.lua
--- a/core/sessionmanager.lua	Wed Feb 05 17:41:40 2020 +0000
+++ b/core/sessionmanager.lua	Wed Feb 05 17:56:20 2020 +0000
@@ -122,13 +122,14 @@
 	retire_session(session);
 end
 
-local function make_authenticated(session, username)
+local function make_authenticated(session, username, scope)
 	username = nodeprep(username);
 	if not username or #username == 0 then return nil, "Invalid username"; end
 	session.username = username;
 	if session.type == "c2s_unauthed" then
 		session.type = "c2s_unbound";
 	end
+	session.auth_scope = scope;
 	session.log("info", "Authenticated as %s@%s", username, session.host or "(unknown)");
 	return true;
 end