You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Adapters/Auth/AuthAdapter.js
+54-1Lines changed: 54 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -34,16 +34,69 @@ export class AuthAdapter {
34
34
}
35
35
36
36
/**
37
+
* Legacy usage, if provided it will be triggered when authData related to this provider is touched (signup/update/login)
38
+
* otherwise you should implement validateSetup, validateLogin and validateUpdate
37
39
@param authData: the client provided authData
38
40
@param options: additional options
39
41
@param req: RestWrite instance with config/auth/data
42
+
@param user: Parse.User instance if Parse.User found
40
43
@returns a promise that resolves, the resolved value will be handled by the server like:
41
44
- resolve undefined|void|{} parse server will save authData
42
45
- resolve { doNotSave: boolean, response: Object} parse server will do not save provided authData and send response to the client under authDataResponse
43
46
- resolve { response: Object } parse server will save authData and send response to the client under authDataResponse
44
47
- resolve { response: Object, save: Object } parse server will save the object provided into `save` key and send response to the client under authDataResponse
45
48
*/
46
-
validateAuthData(authData,options,req){
49
+
validateAuthData(authData,options,req,user){
50
+
returnPromise.resolve({});
51
+
}
52
+
53
+
/**
54
+
* Triggered when user provide for the first time this auth provider
55
+
@param authData: the client provided authData
56
+
@param options: additional options
57
+
@param req: RestWrite instance with config/auth/data
58
+
@param user: Parse.User instance if Parse.User found
59
+
@returns a promise that resolves, the resolved value will be handled by the server like:
60
+
- resolve undefined|void|{} parse server will save authData
61
+
- resolve { doNotSave: boolean, response: Object} parse server will do not save provided authData and send response to the client under authDataResponse
62
+
- resolve { response: Object } parse server will save authData and send response to the client under authDataResponse
63
+
- resolve { response: Object, save: Object } parse server will save the object provided into `save` key and send response to the client under authDataResponse
64
+
*/
65
+
validateSetUp(authData,options,req,user){
66
+
returnPromise.resolve({});
67
+
}
68
+
69
+
/**
70
+
* Triggered when user provide authData related to this provider
71
+
* he is not logged in and has already set this provider before
72
+
@param authData: the client provided authData
73
+
@param options: additional options
74
+
@param req: RestWrite instance with config/auth/data
75
+
@param user: Parse.User instance if Parse.User found
76
+
@returns a promise that resolves, the resolved value will be handled by the server like:
77
+
- resolve undefined|void|{} parse server will save authData
78
+
- resolve { doNotSave: boolean, response: Object} parse server will do not save provided authData and send response to the client under authDataResponse
79
+
- resolve { response: Object } parse server will save authData and send response to the client under authDataResponse
80
+
- resolve { response: Object, save: Object } parse server will save the object provided into `save` key and send response to the client under authDataResponse
81
+
*/
82
+
validateLogin(authData,options,req,user){
83
+
returnPromise.resolve({});
84
+
}
85
+
86
+
/**
87
+
* Triggered when user provide authData related to this provider
88
+
* he is logged in and has already set this provider before
89
+
@param authData: the client provided authData
90
+
@param options: additional options
91
+
@param req: RestWrite instance with config/auth/data
92
+
@param user: Parse.User instance if Parse.User found
93
+
@returns a promise that resolves, the resolved value will be handled by the server like:
94
+
- resolve undefined|void|{} parse server will save authData
95
+
- resolve { doNotSave: boolean, response: Object} parse server will do not save provided authData and send response to the client under authDataResponse
96
+
- resolve { response: Object } parse server will save authData and send response to the client under authDataResponse
97
+
- resolve { response: Object, save: Object } parse server will save the object provided into `save` key and send response to the client under authDataResponse
0 commit comments