|
@@ -1,6 +1,8 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
2
|
2
|
|
3
|
3
|
import tg
|
|
4
|
+import repoze.who.api
|
|
5
|
+
|
4
|
6
|
from tg import _compat
|
5
|
7
|
from pboard.lib import base as plb
|
6
|
8
|
from pboard.lib import dbapi as pld
|
|
@@ -48,4 +50,13 @@ class PODPublicApiController(plb.BaseController):
|
48
|
50
|
pm.DBSession.flush()
|
49
|
51
|
|
50
|
52
|
tg.flash(_('Account successfully created: %s') % (email), 'info')
|
|
53
|
+
|
|
54
|
+ who_api = repoze.who.api.get_api(tg.request.environ)
|
|
55
|
+ creds = {}
|
|
56
|
+ creds['login'] = email
|
|
57
|
+ creds['password'] = password
|
|
58
|
+ authenticated, headers = who_api.login(creds)
|
|
59
|
+ tg.response.headers = headers
|
|
60
|
+
|
51
|
61
|
tg.redirect(tg.lurl('/'))
|
|
62
|
+
|