Fixes an error client.
This commit is contained in:
		
							parent
							
								
									c605c9fadf
								
							
						
					
					
						commit
						e8ace8a6eb
					
				
					 2 changed files with 2 additions and 4 deletions
				
			
		|  | @ -318,7 +318,7 @@ module AuthD | |||
| 			end | ||||
| 		end | ||||
| 
 | ||||
| 		def get_user?(login : String, password : String) : Passwd::User? | ||||
| 		def get_user?(login : String, password : String) : AuthD::User::Public? | ||||
| 			send Request::GetUserByCredentials.new login, password | ||||
| 
 | ||||
| 			response = Response.from_ipc read | ||||
|  |  | |||
|  | @ -17,13 +17,11 @@ class AuthD::Token | |||
| 	end | ||||
| 
 | ||||
| 	def to_s(key) | ||||
| 		JWT.encode to_h.to_json, key, JWT::Algorithm::HS256 | ||||
| 		JWT.encode to_h, key, JWT::Algorithm::HS256 | ||||
| 	end | ||||
| 
 | ||||
| 	def self.from_s(key, str) | ||||
| 		payload, meta = JWT.decode str, key, JWT::Algorithm::HS256 | ||||
| 		puts "PAYLOAD BELOW, BEWARE" | ||||
| 		pp! payload | ||||
| 
 | ||||
| 		self.new payload["login"].as_s, payload["uid"].as_i | ||||
| 	end | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Luka Vandervelden
						Luka Vandervelden