angularjs - How to create custom login functionality in loopback -


recently,i started working on loopback , facing 1 issue in project. in project using built in loopback user.login functionality that's provide feature login our site providing email , password, password mandatory field. so, problem password field, want provide login functionality without using password in place of password want check facebook id, not understand how use built in loopback user.login model 2 parameter 1 email , second facebook id instead of password. in case getting email id , basic information facebook using javascript (i not using facebook-passport package), instead of password want pass email , facebook id in user.login model. project rest api , storing user data in local storage, want create costume login functionality.

create custom function in model , define remote method path /login.

user.mylogin = function(data, cb){ // data.username // data.password // data.facebookid };  user.remotemethod(   'mylogin',   {    accepts: [{                 arg: 'data',                 type: 'object',                 required: true,                 http: {                     source: 'body'                 }             }],             returns: {                 arg: 'result',                 type: 'object',                 root: true             },             http: {                 path: "/login",                 verb: 'post',                 status: 201             }   } ); 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -