Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
af46e1b4
Commit
af46e1b4
authored
13 years ago
by
Lloyd Hilaiel
Browse files
Options
Downloads
Patches
Plain Diff
implement stubbed email verification loop.
parent
0ff7ff26
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
authority/server/db.js
+18
-7
18 additions, 7 deletions
authority/server/db.js
authority/server/email.js
+7
-1
7 additions, 1 deletion
authority/server/email.js
with
25 additions
and
8 deletions
authority/server/db.js
+
18
−
7
View file @
af46e1b4
...
...
@@ -3,14 +3,11 @@ var g_emails = {
};
// half created user accounts (pending email verification)
var
g_stagedUsers
=
{
};
// OR
// half added emails (pending verification)
var
g_staged
Emails
=
{
var
g_staged
=
{
};
exports
.
haveEmail
=
function
(
email
)
{
return
g_emails
.
hasOwnProperty
(
email
);
};
...
...
@@ -28,10 +25,24 @@ function generateSecret() {
exports
.
stageUser
=
function
(
obj
)
{
var
secret
=
generateSecret
();
// overwrite previously staged users
g_staged
U
se
rs
[
obj
.
email
]
=
{
secret
:
secret
,
g_staged
[
se
cret
]
=
{
email
:
obj
.
email
,
pubkey
:
obj
.
pubkey
,
pass
:
obj
.
pass
};
return
secret
;
};
/* invoked when a user clicks on a verification URL in their email */
exports
.
gotVerificationSecret
=
function
(
secret
)
{
if
(
!
g_staged
.
hasOwnProperty
(
secret
))
return
false
;
// simply move from staged over to the emails "database"
var
o
=
g_staged
[
secret
];
delete
g_staged
[
secret
];
g_emails
[
o
.
email
]
=
{
pass
:
o
.
pass
,
pubkey
:
o
.
pubkey
};
return
true
;
};
This diff is collapsed.
Click to expand it.
authority/server/email.js
+
7
−
1
View file @
af46e1b4
exports
.
sendVerificationEmail
=
function
(
email
,
hash
)
{
exports
.
sendVerificationEmail
=
function
(
email
,
secret
)
{
console
.
log
(
"
fakely sending a verification email for
"
+
email
);
// XXX: what we would really do here is send out an email, instead
// we'll just wait 5 seconds and manually feed the secret back into the
// system, as if a user had clicked a link
setTiemout
(
function
()
{
db
.
gotVerificationSecret
(
secret
);
},
5000
);
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment